jpisaac commented on a change in pull request #724: PHOENIX-5629 Phoenix 
Function to Return HBase row timestamp
URL: https://github.com/apache/phoenix/pull/724#discussion_r406953489
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/expression/function/PhoenixRowTimestampFunction.java
 ##########
 @@ -0,0 +1,125 @@
+/*
+ * 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.expression.function;
+
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.io.WritableUtils;
+import org.apache.phoenix.expression.Determinism;
+import org.apache.phoenix.expression.Expression;
+import org.apache.phoenix.parse.FunctionParseNode.BuiltInFunction;
+import org.apache.phoenix.parse.PhoenixRowTimestampParseNode;
+import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
+import org.apache.phoenix.schema.types.PDate;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Function to return the timestamp of the empty column which functions as the 
row timestamp. The
+ * result returned can be used for debugging(eg. using HBase shell), logging 
etc.
+ * Can also be used in sql predicates.
+ */
+@BuiltInFunction(name = PhoenixRowTimestampFunction.NAME,
+        nodeClass= PhoenixRowTimestampParseNode.class,
+        args = {})
+public class PhoenixRowTimestampFunction extends ScalarFunction {
+    public static final String NAME = "PHOENIX_ROW_TIMESTAMP";
+    private byte[] emptyCF;
+    private byte[] emptyCQ;
+
+    public PhoenixRowTimestampFunction() {
+    }
+
+    public PhoenixRowTimestampFunction(List<Expression> children, byte[] 
emptyCF, byte[] emptyCQ) {
+        super(children);
 
 Review comment:
   Will add more comments as discussed offline.

----------------------------------------------------------------
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

Reply via email to