Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PruneTableScanColumns throws an exception when column name contains only non-alphanumeric #21881

Closed
ebyhr opened this issue May 9, 2024 · 1 comment · Fixed by #21883
Closed
Labels
bug Something isn't working

Comments

@ebyhr
Copy link
Member

ebyhr commented May 9, 2024

This issue happened after the last commit of #21204 (SymbolAllocator change)

The following test fail on Hive connector:

    @Test
    public void testColumnName()
    {
        try (TestTable table = new TestTable(getQueryRunner()::execute, "test_name", "AS SELECT 1 \"\"")) {
            assertQuery("SELECT * FROM " + table.getName(), "VALUES (1)");
        }
    }
java.lang.IllegalArgumentException: name is empty
	at io.trino.spi.expression.Variable.<init>(Variable.java:35)
	at io.trino.sql.planner.iterative.rule.PruneTableScanColumns.lambda$pruneColumns$0(PruneTableScanColumns.java:75)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:212)
	at java.base/java.util.Collections$2.tryAdvance(Collections.java:5074)
	at java.base/java.util.Collections$2.forEachRemaining(Collections.java:5082)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:702)
	at io.trino.sql.planner.iterative.rule.PruneTableScanColumns.pruneColumns(PruneTableScanColumns.java:76)
	at io.trino.sql.planner.iterative.rule.PruneTableScanColumns.pushDownProjectOff(PruneTableScanColumns.java:63)
	at io.trino.sql.planner.iterative.rule.PruneTableScanColumns.pushDownProjectOff(PruneTableScanColumns.java:48)
	at io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule.lambda$apply$0(ProjectOffPushDownRule.java:63)
	at java.base/java.util.Optional.flatMap(Optional.java:289)
	at io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule.apply(ProjectOffPushDownRule.java:63)
	at io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule.apply(ProjectOffPushDownRule.java:38)
	at io.trino.sql.planner.iterative.IterativeOptimizer.transform(IterativeOptimizer.java:216)
	at io.trino.sql.planner.iterative.IterativeOptimizer.exploreNode(IterativeOptimizer.java:181)
	at io.trino.sql.planner.iterative.IterativeOptimizer.exploreGroup(IterativeOptimizer.java:144)
	at io.trino.sql.planner.iterative.IterativeOptimizer.exploreChildren(IterativeOptimizer.java:264)
	at io.trino.sql.planner.iterative.IterativeOptimizer.exploreGroup(IterativeOptimizer.java:146)
	at io.trino.sql.planner.iterative.IterativeOptimizer.optimizeAndMarkPlanChanges(IterativeOptimizer.java:129)
	at io.trino.sql.planner.optimizations.AdaptivePlanOptimizer.optimize(AdaptivePlanOptimizer.java:33)
	at io.trino.sql.planner.LogicalPlanner.runOptimizer(LogicalPlanner.java:301)
	at io.trino.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:264)
	at io.trino.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:236)
	at io.trino.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:231)
	at io.trino.execution.SqlQueryExecution.doPlanQuery(SqlQueryExecution.java:498)
	at io.trino.execution.SqlQueryExecution.planQuery(SqlQueryExecution.java:478)
	at io.trino.execution.SqlQueryExecution.start(SqlQueryExecution.java:416)
	at io.trino.execution.SqlQueryManager.createQuery(SqlQueryManager.java:272)
	at io.trino.dispatcher.LocalDispatchQuery.startExecution(LocalDispatchQuery.java:145)
	at io.trino.dispatcher.LocalDispatchQuery.lambda$waitForMinimumWorkers$2(LocalDispatchQuery.java:129)
	at io.airlift.concurrent.MoreFutures.lambda$addSuccessCallback$12(MoreFutures.java:570)
	at io.airlift.concurrent.MoreFutures$3.onSuccess(MoreFutures.java:545)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1137)
	at io.trino.$gen.Trino_testversion____20240509_062117_71.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1570)
@ebyhr ebyhr added the bug Something isn't working label May 9, 2024
@ebyhr
Copy link
Member Author

ebyhr commented May 9, 2024

cc: @martint @dain @findepi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant