[
https://issues.apache.org/jira/browse/HIVE-21614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17371613#comment-17371613
]
Hank Fanchiu commented on HIVE-21614:
-------------------------------------
Hi [~pvary],
Continuing the discussion from
[https://github.com/apache/iceberg/pull/2722#issuecomment-867420525,] how would
you suggest fixing this in Hive?
Looking at {{org.apache.hadoop.hive.metastore.ObjectStore}}, I see that there
is the existing pattern of checking {{SQLGenerator.getDbProduct().isDERBY()}},
e.g.:
https://github.com/apache/hive/blob/dc8891ec9459d2eff5a23154383ec3bd19481fd2/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L11146
However, I don't think that it would be appropriate to do so within
{{ObjectStore#listTableNamesByFilter}} without doing fragile string replacement:
https://github.com/apache/hive/blob/f7a21abf5579a8df07117928caff2d72ecae27e3/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L4793-L4833
One level lower, {{org.apache.hadoop.hive.metastore.parser.ExpressionTree}} has
no concern with the database product.
> Derby does not support CLOB comparisons
> ---------------------------------------
>
> Key: HIVE-21614
> URL: https://issues.apache.org/jira/browse/HIVE-21614
> Project: Hive
> Issue Type: Bug
> Components: Metastore
> Affects Versions: 2.3.4, 3.0.0
> Reporter: Vlad Rozov
> Priority: Major
>
> HiveMetaStoreClient.listTableNamesByFilter() with non empty filter causes
> exception with Derby DB:
> {noformat}
> Caused by: ERROR 42818: Comparisons between 'CLOB (UCS_BASIC)' and 'CLOB
> (UCS_BASIC)' are not supported. Types must be comparable. String types must
> also have matching collation. If collation does not match, a possible
> solution is to cast operands to force them to the default collation (e.g.
> SELECT tablename FROM sys.systables WHERE CAST(tablename AS VARCHAR(128)) =
> 'T1')
> at org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
> at org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
> at
> org.apache.derby.impl.sql.compile.BinaryComparisonOperatorNode.bindComparisonOperator(Unknown
> Source)
> at
> org.apache.derby.impl.sql.compile.BinaryComparisonOperatorNode.bindExpression(Unknown
> Source)
> at
> org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown
> Source)
> at
> org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown
> Source)
> at org.apache.derby.impl.sql.compile.AndNode.bindExpression(Unknown
> Source)
> at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(Unknown
> Source)
> at
> org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(Unknown
> Source)
> at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown
> Source)
> at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown
> Source)
> at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
> at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
> at
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown
> Source)
> ... 42 more
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)