APISonar


com.dremio.service.namespace.file.proto.FileType.JSON

> com > dremio > service > namespace > file > proto > FileType > JSON
com APIs dremio APIs service APIs namespace APIs file APIs proto APIs FileType APIs JSON APIs

Example 1
public void testDefaultFileFormatForJsonFile() throws Exception {
    String filePath = getUrlPath("/json/mixed.json");
    FileFormat fileFormat = expectSuccess(getBuilder(getAPIv2().path("/source/dacfs_test/file_format/" + filePath)).buildGet(),
      FileFormatUI.class).getFileFormat();
    assertEquals(FileType.JSON, fileFormat.getFileType());
  }
Example 2
public void addJson(DatasetPath path, DatasetPath vdsPath) throws Exception {
    final DatasetConfig dataset = new DatasetConfig()
        .setType(DatasetType.PHYSICAL_DATASET_SOURCE_FILE)
        .setFullPathList(path.toPathList())
        .setName(path.getLeaf().getName())
        .setCreatedAt(System.currentTimeMillis())
        .setTag(null)
        .setOwner(DEFAULT_USERNAME)
        .setPhysicalDataset(new PhysicalDataset()
            .setFormatSettings(new FileConfig().setType(FileType.JSON))
            );
    final NamespaceService nsService = getNamespaceService();
    nsService.addOrUpdateDataset(path.toNamespaceKey(), dataset);
    createDatasetFromParentAndSave(vdsPath, path.toPathString());
  }