a-simeshin commented on code in PR #4259:
URL: https://github.com/apache/calcite/pull/4259#discussion_r2174357400
##########
core/src/test/java/org/apache/calcite/test/ReflectiveSchemaTest.java:
##########
@@ -737,25 +742,28 @@ private void checkOp(CalciteAssert.AssertThat with,
String fn) {
*
* @see CatchallSchema#enumerable
* @see CatchallSchema#list */
- @Test void testSchemaFieldHasBadType() {
+ @Test void testSchemaFieldHasBadAndProperType() {
final CalciteAssert.AssertThat with =
CalciteAssert.that().withSchema("s", CATCHALL);
// BitSet is not a valid relation type. It's as if "bitSet" field does
// not exist.
with.query("select * from \"s\".\"bitSet\"")
.throws_("Object 'bitSet' not found within 's'");
- // Enumerable field returns 3 records with 0 fields
- with.query("select * from \"s\".\"enumerable\"")
- .returns("\n"
- + "\n"
- + "\n"
- + "\n");
- // List is implicitly converted to Enumerable
- with.query("select * from \"s\".\"list\"")
- .returns("\n"
- + "\n"
- + "\n"
- + "\n");
+
+ final String employees = new StringBuilder()
Review Comment:
>why is this result different?
Before this change, ReflectiveSchema correctly determined that there were 3
records in the enumerable table, but there was no mechanism for deduce fields
within in a collection type.
The mechanism worked only for arrays, but now it works for collections, so
it not only defines 3 objects in the enumerable table, but also correctly
handles the selection by this table with the display of fields instead of empty
strings.
Comment in the test before:
`// Enumerable field returns 3 records with 0 fields`
>was the previous result wrong?
The previous result was correct for the implementation before the PR
changes, but now the test needs to be adjusted.
--
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]