File tree Expand file tree Collapse file tree
src/test/java/org/apache/datafusion Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424import static org .junit .jupiter .api .Assertions .assertThrows ;
2525import static org .junit .jupiter .api .Assertions .assertTrue ;
2626
27+ import java .nio .file .Path ;
28+
2729import org .apache .arrow .memory .BufferAllocator ;
2830import org .apache .arrow .memory .RootAllocator ;
2931import org .apache .arrow .vector .ipc .ArrowReader ;
3032import org .apache .datafusion .protobuf .SessionOptions ;
3133import org .junit .jupiter .api .Test ;
34+ import org .junit .jupiter .api .io .TempDir ;
3235
3336class SessionContextBuilderTest {
3437
@@ -91,4 +94,23 @@ void informationSchemaDisabledByDefaultThrows() {
9194 () -> ctx .sql ("SELECT table_name FROM information_schema.tables" ));
9295 }
9396 }
97+
98+ @ Test
99+ void buildWithEveryKnobSetCanExecuteSelectOne (@ TempDir Path tempDir ) throws Exception {
100+ try (BufferAllocator allocator = new RootAllocator ();
101+ SessionContext ctx =
102+ SessionContext .builder ()
103+ .batchSize (8192 )
104+ .targetPartitions (4 )
105+ .collectStatistics (true )
106+ .informationSchema (true )
107+ .memoryLimit (1L << 30 , 0.8 )
108+ .tempDirectory (tempDir .toAbsolutePath ().toString ())
109+ .build ();
110+ DataFrame df = ctx .sql ("SELECT 1" );
111+ ArrowReader reader = df .collect (allocator )) {
112+ assertTrue (reader .loadNextBatch ());
113+ assertEquals (1 , reader .getVectorSchemaRoot ().getRowCount ());
114+ }
115+ }
94116}
You can’t perform that action at this time.
0 commit comments