@Test
@Ignore("interval")
public void checkReadWriteExtended() throws Exception {
final String originalFile = "${WORKING_PATH}/src/test/resources/vector/complex/extended.json".replaceAll(
Pattern.quote("${WORKING_PATH}"),
Matcher.quoteReplacement(TestTools.getWorkingPath()));
final String newTable = "TestExtendedTypes/newjson";
try {
testNoResult(String.format("ALTER SESSION SET \"%s\" = 'json'", ExecConstants.OUTPUT_FORMAT_VALIDATOR.getOptionName()));
testNoResult(String.format("ALTER SESSION SET \"%s\" = true", ExecConstants.JSON_EXTENDED_TYPES.getOptionName()));
test("create table dfs_test.tmp.\"%s\" as select * from dfs.\"%s\"", newTable, originalFile);
test("select * from dfs_test.tmp.\"%s\"", newTable);
final byte[] originalData = Files.readAllBytes(Paths.get(originalFile));
final byte[] newData = Files.readAllBytes(Paths.get(BaseTestQuery.getDfsTestTmpSchemaLocation() + '/' + newTable
+ "/0_0_0.json"));
assertEquals(new String(originalData), new String(newData));
} finally {
testNoResult(String.format("ALTER SESSION SET \"%s\" = '%s'",
ExecConstants.OUTPUT_FORMAT_VALIDATOR.getOptionName(),
ExecConstants.OUTPUT_FORMAT_VALIDATOR.getDefault().getValue()));
testNoResult(String.format("ALTER SESSION SET \"%s\" = %s",
ExecConstants.JSON_EXTENDED_TYPES.getOptionName(),
ExecConstants.JSON_EXTENDED_TYPES.getDefault().getValue()));
}
}