wuchong commented on a change in pull request #9045: [FLINK-12955][hbase] Support LookupableTableSource for HBase URL: https://github.com/apache/flink/pull/9045#discussion_r301632360
########## File path: flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/util/HBaseTypeUtils.java ########## @@ -0,0 +1,174 @@ +/* + * 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.flink.addons.hbase.util; + +import org.apache.flink.annotation.Internal; +import org.apache.flink.api.common.typeinfo.TypeInformation; + +import org.apache.commons.net.ntp.TimeStamp; +import org.apache.hadoop.hbase.util.Bytes; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.charset.Charset; +import java.sql.Date; +import java.sql.Time; +import java.sql.Timestamp; + +/** + * A utility class to process data exchange with HBase type system. + */ +@Internal +public class HBaseTypeUtils { + + private static final byte[] EMPTY_BYTES = new byte[]{}; + + /** + * Deserialize byte array to Java Object with the given type. + */ + public static Object deserializeToObject(byte[] value, int typeIdx, Charset stringCharset) { Review comment: I think methods in utility should be public (otherwise why we put them in a Utility class?), even though they are invoked in the same package. In the other hand, they may used across package in the future when we introduce hbase sink. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
