title: Query Large Data from Fusion Tables from Google Apps Script
body: <p>I've loaded a 66 MB csv file to Fusion Tables. It's about 475k rows long and 12 columns wide.</p>
  
  <p>I'm using Google Apps Script and trying to query the data within there.</p>
  
  <p>One of the columns is the name of the person who that data belongs to, for instance, Joe.</p>
  
  <p>If I want to pull all of Joe's data out so I can display it to him in a nice format, I'm using this query:</p>
  
  <pre><code>var tableId = my_table_id;
  var sql1 = "SELECT * FROM " + tableId + " WHERE 'User' = 'Joe'";
  var result = FusionTables.Query.sql(sql1,{hdrs : false});
  </code></pre>
  
  <p>The issue is that Joe has about 52k lines of data. I want to return it so I can load it to a datable and the user can sort through it and view all of the data. I get one of two errors:</p>
  
  <p>If I run the query as above I get:</p>
  
  <ul>
  <li>Response Code: 413. Message: response too large.</li>
  </ul>
  
  <p>If I just try to select it all (SELECT * FROM tableId), I get:</p>
  
  <ul>
  <li>Response size is larger than 10 MB. Please use media download</li>
  </ul>
  
  <p>For media download, I've tried specifying alt : 'media' in the parameters, but I don't think that works within Google Apps script (I can't find documentation on it anywhere).</p>
  
  <p>I have also tried looping through the queries, so select * limit 0,1000, then select * limit 1001,2000, ect. However, fusion tables SQL doesn't seem to support that either.</p>
  
  <p>At this point, I may just leave the CSV in my drive, parse it in on the fly, but that's my last resort. Any advice would be appreciated!</p>