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

fix(flink): correct the translation of ops.Power #7144

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

deepyaman
Copy link
Contributor

No description provided.

@cpcloud cpcloud added this to the 7.0 milestone Sep 13, 2023
@cpcloud cpcloud added bug Incorrect behavior inside of ibis flink Issues or PRs related to Flink labels Sep 13, 2023
@cpcloud cpcloud enabled auto-merge (rebase) September 13, 2023 14:37
@cpcloud
Copy link
Member

cpcloud commented Sep 13, 2023

Does this need a test to prevent a regression?

@deepyaman
Copy link
Contributor Author

Does this need a test to prevent a regression?

It's already being (or will be?) tested as part of the common backend test suite. As I've been going through the failures in #6920, I've been extracting the fixes for whatever I can (so, in the end, that PR will just contain all the stuff marked notimpl, etc.). Once that is able to be merged, all of these kinds of things are getting tested automatically.

Prior to this PR, if I run the test suite, as enabled on that branch:

E                   py4j.protocol.Py4JJavaError: An error occurred while calling o8.sqlQuery.
E                   : org.apache.flink.table.api.ValidationException: SQL validation failed. From line 1, column 8 to line 1, column 67: No match found for function signature pow(<NUMERIC>, <NUMERIC>)
E                       at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:187)
E                       at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.validate(FlinkPlannerImpl.scala:113)
E                       at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:281)
E                       at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:106)
E                       at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlQuery(TableEnvironmentImpl.java:738)
E                       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
E                       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
E                       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
E                       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
E                       at org.apache.flink.api.python.shaded.py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
E                       at org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:374)
E                       at org.apache.flink.api.python.shaded.py4j.Gateway.invoke(Gateway.java:282)
E                       at org.apache.flink.api.python.shaded.py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
E                       at org.apache.flink.api.python.shaded.py4j.commands.CallCommand.execute(CallCommand.java:79)
E                       at org.apache.flink.api.python.shaded.py4j.GatewayConnection.run(GatewayConnection.java:238)
E                       at java.base/java.lang.Thread.run(Thread.java:829)
E                   Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, column 8 to line 1, column 67: No match found for function signature pow(<NUMERIC>, <NUMERIC>)
E                       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
E                       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
E                       at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
E                       at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
E                       at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:505)
E                       at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:932)
E                       at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:917)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5163)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.handleUnresolvedFunction(SqlValidatorImpl.java:1949)
E                       at org.apache.calcite.sql.SqlFunction.deriveType(SqlFunction.java:326)
E                       at org.apache.calcite.sql.SqlFunction.deriveType(SqlFunction.java:231)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:6218)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:6203)
E                       at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:161)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1861)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1852)
E                       at org.apache.calcite.sql.SqlAsOperator.deriveType(SqlAsOperator.java:133)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:6218)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:6203)
E                       at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:161)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1861)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1852)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.expandSelectItem(SqlValidatorImpl.java:449)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelectList(SqlValidatorImpl.java:4324)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3570)
E                       at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:64)
E                       at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:89)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1042)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1017)
E                       at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:247)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:992)
E                       at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:741)
E                       at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$validate(FlinkPlannerImpl.scala:183)
E                       ... 15 more
E                   Caused by: org.apache.calcite.sql.validate.SqlValidatorException: No match found for function signature pow(<NUMERIC>, <NUMERIC>)
E                       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
E                       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
E                       at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
E                       at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
E                       at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:505)
E                       at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:599)
E                       ... 43 more

/home/vscode/miniconda3/envs/ibis-dev/lib/python3.10/site-packages/py4j/protocol.py:326: Py4JJavaError
-------------------------------------------- generated xml file: /workspaces/ibis/junit.xml ---------------------------------------------

---------- coverage: platform linux, python 3.10.12-final-0 ----------
Coverage XML written to file coverage.xml

======================================================== short test summary info ========================================================
FAILED ibis/backends/tests/test_numeric.py::test_binary_arithmetic_operations[flink-pow] - py4j.protocol.Py4JJavaError: An error occurred while calling o8.sqlQuery.
================================================== 1 failed, 2537 deselected in 18.08s ==================================================

@cpcloud
Copy link
Member

cpcloud commented Sep 13, 2023

SGTM! Thanks for the explanation.

@cpcloud
Copy link
Member

cpcloud commented Sep 13, 2023

The impala failure is unrelated (github actions hiccup)

@cpcloud cpcloud merged commit 42d2236 into ibis-project:master Sep 13, 2023
85 of 86 checks passed
@deepyaman deepyaman deleted the patch-1 branch September 13, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis flink Issues or PRs related to Flink
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants