Skip to content

Commit dc0c2cb

Browse files
committed
fix(session-context): add build() Javadoc and tighten info_schema assertion
1 parent c768d16 commit dc0c2cb

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/main/java/org/apache/datafusion/SessionContextBuilder.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public SessionContextBuilder tempDirectory(String path) {
7272
return this;
7373
}
7474

75+
/**
76+
* Construct a {@link SessionContext} with the configured options.
77+
*
78+
* @throws RuntimeException if the native side fails to construct the context.
79+
*/
7580
public SessionContext build() {
7681
return new SessionContext(toBytes());
7782
}

‎src/test/java/org/apache/datafusion/SessionContextBuilderTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ void informationSchemaEnabledMakesMetaQueryRun() throws Exception {
7878
SessionContext ctx = SessionContext.builder().informationSchema(true).build();
7979
DataFrame df = ctx.sql("SELECT table_name FROM information_schema.tables");
8080
ArrowReader reader = df.collect(allocator)) {
81-
// Loading a batch is enough to prove the query planned and executed.
82-
reader.loadNextBatch();
81+
// information_schema.tables always has at least one row.
82+
assertTrue(reader.loadNextBatch());
8383
}
8484
}
8585

0 commit comments

Comments
 (0)