stoty commented on code in PR #2020: URL: https://github.com/apache/phoenix/pull/2020#discussion_r1842610701
########## phoenix-core/src/it/java/org/apache/phoenix/end2end/DecodeBinaryFunctionIT.java: ########## @@ -0,0 +1,202 @@ +/* + * 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.phoenix.end2end; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Arrays; + +import org.apache.phoenix.exception.SQLExceptionCode; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category(ParallelStatsDisabledTest.class) +public class DecodeBinaryFunctionIT extends ParallelStatsDisabledIT { + + @Test + public void testDecodeHBaseFromEscapedHex() throws Exception { + Connection conn = DriverManager.getConnection(getUrl()); + + String testTable = generateUniqueName(); + String ddl = "CREATE TABLE " + testTable + " (id INTEGER PRIMARY KEY, data VARCHAR)"; + + conn.createStatement().execute(ddl); + + PreparedStatement ps = conn.prepareStatement("UPSERT INTO " + testTable + " (id, data) VALUES (1, 'data')"); + ps.execute(); + conn.commit(); + + ResultSet rs = conn.createStatement().executeQuery( + "SELECT DECODE_BINARY('\\\\x48\\\\x65\\\\x6C\\\\x6C\\\\x6F\\\\x50" + Review Comment: Having four blackslashes doesn not seem right. The other examples have only two. Java String requires doubling them, by why do we need to double them again ? -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org