[ 
https://issues.apache.org/jira/browse/HIVE-21614?focusedWorklogId=623503&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-623503
 ]

ASF GitHub Bot logged work on HIVE-21614:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Jul/21 09:45
            Start Date: 16/Jul/21 09:45
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2484:
URL: https://github.com/apache/hive/pull/2484#discussion_r671114558



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/OperatorEqualsToLikeReplacer.java
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.metastore;
+
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
+import org.apache.hadoop.hive.metastore.parser.ExpressionTree.LeafNode;
+import org.apache.hadoop.hive.metastore.parser.ExpressionTree.Operator;
+import org.apache.hadoop.hive.metastore.parser.ExpressionTree.TreeVisitor;
+
+/**
+ * Replaces any {@link Operator.EQUALS} with {@link Operator.LIKE} for {@link 
LeafNode}
+ * representing an equality comparison on a table parameter.
+ * 
+ * This utility is effective for database products that do not support 
equality comparisons
+ * between values of the CLOB type.
+ */
+final class OperatorEqualsToLikeReplacer extends TreeVisitor {
+  @Override
+  protected void visit(LeafNode node) throws MetaException {
+    if (

Review comment:
       nit: Could we format this way:
   ```
         if 
(node.keyName.startsWith(hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS)
             && node.operator == Operator.EQUALS) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 623503)
    Time Spent: 40m  (was: 0.5h)

> 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
>            Assignee: Hank Fanchiu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> 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)

Reply via email to