This is an automated email from the ASF dual-hosted git repository. vlsi pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git
commit 1b291df8b5c913a1c5c6ae3ea867155cd6785d96 Author: Vladimir Sitnikov <[email protected]> AuthorDate: Thu Nov 19 11:03:17 2026 +0300 [CALCITE-7949] Reword the PigTable scan error so it does not suggest an empty table "has a row type and no rows" read as an empty table, which could be scanned. PigTable is not empty: it holds the schema of a Pig relation and has no access to the data behind it, and its statistics report 10 rows. User-visible: Executing a plan that scans a PigTable fails with UnsupportedOperationException: PigTable holds only the schema of a Pig relation and cannot read its data Co-Authored-By: Claude Opus 5.5 <[email protected]> --- piglet/src/main/java/org/apache/calcite/piglet/PigTable.java | 2 +- piglet/src/test/java/org/apache/calcite/test/PigRelOpTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/piglet/src/main/java/org/apache/calcite/piglet/PigTable.java b/piglet/src/main/java/org/apache/calcite/piglet/PigTable.java index a00b2199a0..e7577b3141 100644 --- a/piglet/src/main/java/org/apache/calcite/piglet/PigTable.java +++ b/piglet/src/main/java/org/apache/calcite/piglet/PigTable.java @@ -72,6 +72,6 @@ public static RelOptTable createRelOptTable(RelOptSchema schema, @Override public Enumerable<@Nullable Object[]> scan(final DataContext root) { throw new UnsupportedOperationException( - "PigTable has a row type and no rows; it cannot be scanned"); + "PigTable holds only the schema of a Pig relation and cannot read its data"); } } diff --git a/piglet/src/test/java/org/apache/calcite/test/PigRelOpTest.java b/piglet/src/test/java/org/apache/calcite/test/PigRelOpTest.java index 0c3a2db13e..da03c97e73 100644 --- a/piglet/src/test/java/org/apache/calcite/test/PigRelOpTest.java +++ b/piglet/src/test/java/org/apache/calcite/test/PigRelOpTest.java @@ -211,7 +211,8 @@ private Fluent pig(String script) { .assertRel(hasTree("LogicalTableScan(table=[[scott, DEPT]])\n")); } - /** A table loaded with a Pig schema has a row type and no rows to read. */ + /** A table loaded with a Pig schema holds only that schema and cannot be + * scanned. */ @Test void testExecuteLoadWithSchema() throws IOException { final RelNode rel = converter.pigQuery2Rel("A = LOAD 'testSchema.testTable' as (a:int, b:chararray);")
