Hello Drillers,
I'm encountering a strange error in a unit test. The code is included below,
and it fails because when Drill attempts to execute the test, it cannot find
the function st_astext(). If I build Drill and execute the query in the CLI it
works, so I suspect there is some environment issue rather than a Drill issue.
Does anyone have any suggestions?
Thanks!
@BeforeClass
public static void setup() throws Exception {
startCluster(ClusterFixture.builder(dirTestWatcher));
DrillbitContext context = cluster.drillbit().getContext();
FileSystemConfig original = (FileSystemConfig)
context.getStorage().getPlugin("cp").getConfig();
Map<String, FormatPluginConfig> newFormats = new
HashMap<>(original.getFormats());
newFormats.put("shp", new ShpFormatConfig());
FileSystemConfig pluginConfig = new
FileSystemConfig(original.getConnection(), original.getConfig(),
original.getWorkspaces(), newFormats);
pluginConfig.setEnabled(true);
context.getStorage().createOrUpdate("cp", pluginConfig, true);
}
...
@Test
public void testShpQuery() throws Exception {
testBuilder()
.sqlQuery("select gid, srid, shapeType, name, st_astext(geom) as wkt "
+ "from cp.`CA-cities.shp` where gid = 100")
.ordered()
.baselineColumns("gid", "srid", "shapeType", "name", "wkt")
.baselineValues(100, 4326, "Point", "Jenny Lind", "POINT (-120.8699371
38.0949216)")
.build()
.run();
}