use of org.apache.spark.sql.sources.v2.DataSourceOptions in project TileDB-Spark by TileDB-Inc.
the class TileDBDataSourceOptionsTest method testTileDBSchemaDims.
@Test
public void testTileDBSchemaDims() throws Exception {
HashMap<String, String> optionMap = new HashMap<>();
optionMap.put("uri", "s3://foo/bar");
optionMap.put("schema.dim.0.name", "rows");
optionMap.put("schema.dim.1.name", "cols");
TileDBDataSourceOptions options = new TileDBDataSourceOptions(new DataSourceOptions(optionMap));
Assert.assertTrue(options.getSchemaDimensionNames().isPresent());
List<Pair<String, Integer>> schemaDims = options.getSchemaDimensionNames().get();
Assert.assertEquals("rows", schemaDims.get(0).getFirst());
Assert.assertEquals(Integer.valueOf(0), schemaDims.get(0).getSecond());
Assert.assertEquals("cols", schemaDims.get(1).getFirst());
Assert.assertEquals(Integer.valueOf(1), schemaDims.get(1).getSecond());
}
use of org.apache.spark.sql.sources.v2.DataSourceOptions in project TileDB-Spark by TileDB-Inc.
the class TileDBDataSourceOptionsTest method testInvalidLayoutOptions.
@Test(expected = IllegalArgumentException.class)
public void testInvalidLayoutOptions() throws Exception {
HashMap<String, String> optionMap = new HashMap<>();
optionMap.put("order", "bad-layout-option");
TileDBDataSourceOptions options = new TileDBDataSourceOptions(new DataSourceOptions(optionMap));
Optional<Layout> layout = options.getArrayLayout();
}
use of org.apache.spark.sql.sources.v2.DataSourceOptions in project TileDB-Spark by TileDB-Inc.
the class TileDBDataSourceOptionsTest method testEmptyDimensionPartitions.
@Test
public void testEmptyDimensionPartitions() throws Exception {
HashMap<String, String> optionMap = new HashMap<>();
TileDBDataSourceOptions options = new TileDBDataSourceOptions(new DataSourceOptions(optionMap));
Optional<List<OptionDimPartition>> partitions = options.getDimPartitions();
Assert.assertFalse(partitions.isPresent());
}
use of org.apache.spark.sql.sources.v2.DataSourceOptions in project TileDB-Spark by TileDB-Inc.
the class TileDBDataSourceOptionsTest method testNoArrayLayoutOption.
@Test
public void testNoArrayLayoutOption() throws Exception {
HashMap<String, String> optionMap = new HashMap<>();
TileDBDataSourceOptions options = new TileDBDataSourceOptions(new DataSourceOptions(optionMap));
Assert.assertFalse(options.getArrayLayout().isPresent());
}
use of org.apache.spark.sql.sources.v2.DataSourceOptions in project TileDB-Spark by TileDB-Inc.
the class TileDBDataSourceOptionsTest method testEmptyTileDBSchemaDims.
@Test
public void testEmptyTileDBSchemaDims() throws Exception {
HashMap<String, String> optionMap = new HashMap<>();
optionMap.put("uri", "s3://foo/bar");
TileDBDataSourceOptions options = new TileDBDataSourceOptions(new DataSourceOptions(optionMap));
Assert.assertFalse(options.getSchemaDimensionNames().isPresent());
}
Aggregations