Vladimir Sitnikov created CALCITE-7949:
------------------------------------------

             Summary: Piglet: executing a plan that scans a PigTable throws 
NullPointerException
                 Key: CALCITE-7949
                 URL: https://issues.apache.org/jira/browse/CALCITE-7949
             Project: Calcite
          Issue Type: Bug
          Components: piglet
    Affects Versions: 1.42.0
            Reporter: Vladimir Sitnikov


A table loaded with a Pig schema converts to a plan, but executing that plan 
throws a NullPointerException, because PigTable.scan returns null.

{code:java}
RelNode rel = converter.pigQuery2Rel(
    "A = LOAD 'testSchema.testTable' as (a:int, b:chararray);").get(0);
RelRunners.run(rel).executeQuery();
{code}

fails with:

{noformat}
java.lang.NullPointerException: Cannot invoke 
"org.apache.calcite.linq4j.Enumerable.select(org.apache.calcite.linq4j.function.Function1)"
 because "enumerable" is null
{noformat}

(converter is the PigConverter used in PigRelOpTest.)

Expected: execution fails with an error that says the table has no rows to 
scan, for example UnsupportedOperationException from PigTable.scan.

Reproduced on main at 9801f30e72 with OpenJDK 21.0.9.

Found while reviewing CALCITE-7736, which keeps PigTable.scan returning null.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to