emkornfield commented on a change in pull request #10652:
URL: https://github.com/apache/arrow/pull/10652#discussion_r716134747
##########
File path:
java/dataset/src/test/java/org/apache/arrow/dataset/file/TestFileSystemDataset.java
##########
@@ -128,6 +128,51 @@ public void testParquetBatchSize() throws Exception {
AutoCloseables.close(datum);
}
+ @Test
+ public void testEmptyProject() throws Exception {
+ ParquetWriteSupport writeSupport =
ParquetWriteSupport.writeTempFile(AVRO_SCHEMA_USER, TMP.newFolder(), 1, "a");
+
+ FileSystemDatasetFactory factory = new
FileSystemDatasetFactory(rootAllocator(), NativeMemoryPool.getDefault(),
+ FileFormat.PARQUET, writeSupport.getOutputURI());
+ ScanOptions options = new ScanOptions(100, new String[0]);
+ Schema schema = inferResultSchemaFromFactory(factory, options);
+ List<ArrowRecordBatch> datum = collectResultFromFactory(factory, options);
+ org.apache.avro.Schema expectedSchema =
org.apache.avro.Schema.createRecord(Collections.emptyList());
+
+ assertSingleTaskProduced(factory, options);
+ assertEquals(0, schema.getFields().size());
+ assertEquals(1, datum.size());
+ checkParquetReadResult(schema,
+ Collections.singletonList(
+ new GenericRecordBuilder(
+ expectedSchema)
+ .build()), datum);
+
+ AutoCloseables.close(datum);
+ }
+
+ @Test
+ public void testNullProject() throws Exception {
Review comment:
please try to name tests like. testNullProjectSelectsAllColumns
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]