APISonar


com.dremio.dac.explore.model.DownloadFormat.CSV

> com > dremio > dac > explore > model > DownloadFormat > CSV
com APIs dremio APIs dac APIs explore APIs model APIs DownloadFormat APIs CSV APIs

Example 1
public void testDownloadCsvRest() throws Exception {
    InitialPreviewResponse initialPreviewResponse = createDatasetFromSQL( String.format("select * from %s", dsg1DatasetPath), Collections.emptyList());

    Response response = download(initialPreviewResponse.getJobId(), DownloadFormat.CSV);

    validateAllRows(readDataCsv(response));
  }
Example 2
public void testDownloadWithLimitInDatasetSql() throws Exception {
    final DatasetPath dsPath = new DatasetPath("DG.testDS");
    InitialPreviewResponse initialPreviewResponse = createDatasetFromSQL("select * from DG.dsg1 LIMIT 10 --- comment", asList("cp"));

    Response response = download(initialPreviewResponse.getJobId(), DownloadFormat.CSV);

    final List<TestData> downloadedData = readDataCsv(response);
    assertEquals(10, downloadedData.size());
    for (int i = 0; i < 10; ++i) {
      assertEquals("user" + i, downloadedData.get(i).getUser());
      assertEquals(i%25, downloadedData.get(i).getAge());
      assertEquals("address" + i, downloadedData.get(i).getAddress());
    }
  }