Skip to content

revert TypeManager change to unblock internal pipeline error#24963

Closed
woshizhouyihao wants to merge 1 commit intoprestodb:masterfrom
woshizhouyihao:master
Closed

revert TypeManager change to unblock internal pipeline error#24963
woshizhouyihao wants to merge 1 commit intoprestodb:masterfrom
woshizhouyihao:master

Conversation

@woshizhouyihao
Copy link
Contributor

@woshizhouyihao woshizhouyihao commented Apr 23, 2025

Description

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@woshizhouyihao
Copy link
Contributor Author

We got 2 exceptions from production.

Discussion in old PR: #24961

For this first error, given company policy, cannot share original query here. I think it is introduced by the enum values.

java.lang.IllegalArgumentException: QualifiedObjectName should have exactly 3 parts
	at com.facebook.presto.common.QualifiedObjectName.valueOf(QualifiedObjectName.java:45)
	at com.facebook.presto.common.type.TypeSignatureBase.of(TypeSignatureBase.java:38)
	at com.facebook.presto.common.type.TypeSignature.<init>(TypeSignature.java:101)
	at com.facebook.presto.common.type.TypeSignature.<init>(TypeSignature.java:96)
	at com.facebook.presto.common.type.TypeSignature.parseTypeSignature(TypeSignature.java:216)
	at com.facebook.presto.common.type.TypeSignature.parseTypeSignature(TypeSignature.java:195)
	at com.facebook.presto.sql.analyzer.ExpressionTreeUtils.tryResolveEnumLiteralType(ExpressionTreeUtils.java:149)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.visitDereferenceExpression(ExpressionAnalyzer.java:536)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.visitDereferenceExpression(ExpressionAnalyzer.java:389)
	at com.facebook.presto.sql.tree.DereferenceExpression.accept(DereferenceExpression.java:54)
	at com.facebook.presto.sql.tree.StackableAstVisitor.process(StackableAstVisitor.java:26)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.process(ExpressionAnalyzer.java:412)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.getOperator(ExpressionAnalyzer.java:1603)

Example query snippet for the second error below:

SELECT 
1 
FROM 
(
  SELECT 
    * 
  FROM 
    table_name
  WHERE 
    ds = '2025-04-20'
) p 
WHERE 
p.id2 = x.xxx.xxx.id
)
java.lang.IllegalArgumentException: Cannot find function namespace for type 'x.xxx.xxx'
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218)
	at com.facebook.presto.metadata.FunctionAndTypeManager.getUserDefinedType(FunctionAndTypeManager.java:761)
	at com.facebook.presto.metadata.FunctionAndTypeManager.getType(FunctionAndTypeManager.java:378)
	at com.facebook.presto.metadata.FunctionAndTypeManager$1.getType(FunctionAndTypeManager.java:200)
	at com.facebook.presto.sql.analyzer.ExpressionTreeUtils.tryResolveEnumLiteralType(ExpressionTreeUtils.java:149)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.visitDereferenceExpression(ExpressionAnalyzer.java:536)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.visitDereferenceExpression(ExpressionAnalyzer.java:389)
	at com.facebook.presto.sql.tree.DereferenceExpression.accept(DereferenceExpression.java:54)
	at com.facebook.presto.sql.tree.StackableAstVisitor.process(StackableAstVisitor.java:26)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.process(ExpressionAnalyzer.java:412)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.getOperator(ExpressionAnalyzer.java:1603)
	at com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.visitComparisonExpression(ExpressionAnalyzer.java:608)

Copy link
Contributor

@amitkdutta amitkdutta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @woshizhouyihao for debugging and finding examples.

@amitkdutta
Copy link
Contributor

Folks @pdabre12 is suggesting he is going to come up with a fix asap. May be lets wait for revert?

@pdabre12
Copy link
Contributor

Raised a PR #24981

@woshizhouyihao
Copy link
Contributor Author

will merge #24981 for a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants