You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2020/07/06 21:59:58 UTC

[incubator-datasketches-hive] branch master updated: Fix typos.

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 030290b  Fix typos.
030290b is described below

commit 030290b238deca6fe2b4467d6dc1172232cb4e3f
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Mon Jul 6 14:59:26 2020 -0700

    Fix typos.
---
 .../java/org/apache/datasketches/hive/hll/DataToSketchUDAF.java   | 8 ++++----
 .../java/org/apache/datasketches/hive/hll/SketchToStringUDF.java  | 2 +-
 .../java/org/apache/datasketches/hive/hll/UnionSketchUDAF.java    | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/datasketches/hive/hll/DataToSketchUDAF.java b/src/main/java/org/apache/datasketches/hive/hll/DataToSketchUDAF.java
index e86aec9..6a4da67 100644
--- a/src/main/java/org/apache/datasketches/hive/hll/DataToSketchUDAF.java
+++ b/src/main/java/org/apache/datasketches/hive/hll/DataToSketchUDAF.java
@@ -50,7 +50,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectIn
     + "> SELECT dataToSketch(val, 12) FROM src;\n"
     + "The return value is a binary blob that can be operated on by other sketch related functions."
     + " The lgK parameter controls the sketch size and rlative error expected from the sketch."
-    + " It is optional an must be from 4 to 21. The default is 12, which is expected to yield errors"
+    + " It is optional and must be from 4 to 21. The default is 12, which is expected to yield errors"
     + " of roughly +-3% in the estimation of uniques with 95% confidence."
     + " The target type parameter is optional and must be 'HLL_4', 'HLL_6' or 'HLL_8'."
     + " The default is 'HLL_4'")
@@ -123,7 +123,7 @@ public class DataToSketchUDAF extends AbstractGenericUDAFResolver {
       // so the mode_ was null. A solution was implemented to have UnionState, which can work
       // in both cases, but SketchState is more space-efficient.
       // HLL sketch is about compactness, so let's use SketchState if possible.
-      if ((mode_ == Mode.PARTIAL1) || (mode_ == Mode.COMPLETE)) { // iterate() will be used
+      if (mode_ == Mode.PARTIAL1 || mode_ == Mode.COMPLETE) { // iterate() will be used
         return new SketchState();
       }
       return new UnionState();
@@ -141,7 +141,7 @@ public class DataToSketchUDAF extends AbstractGenericUDAFResolver {
     public ObjectInspector init(final Mode mode, final ObjectInspector[] parameters) throws HiveException {
       super.init(mode, parameters);
       mode_ = mode;
-      if ((mode == Mode.PARTIAL1) || (mode == Mode.COMPLETE)) {
+      if (mode == Mode.PARTIAL1 || mode == Mode.COMPLETE) {
         // input is original data
         inputInspector_ = (PrimitiveObjectInspector) parameters[0];
         if (parameters.length > 1) {
@@ -155,7 +155,7 @@ public class DataToSketchUDAF extends AbstractGenericUDAFResolver {
         intermediateInspector_ = (StructObjectInspector) parameters[0];
       }
 
-      if ((mode == Mode.PARTIAL1) || (mode == Mode.PARTIAL2)) {
+      if (mode == Mode.PARTIAL1 || mode == Mode.PARTIAL2) {
         // intermediate results need to include the lgK and the target HLL type
         return ObjectInspectorFactory.getStandardStructObjectInspector(
           Arrays.asList(LG_K_FIELD, HLL_TYPE_FIELD, SKETCH_FIELD),
diff --git a/src/main/java/org/apache/datasketches/hive/hll/SketchToStringUDF.java b/src/main/java/org/apache/datasketches/hive/hll/SketchToStringUDF.java
index 1c9a0f5..580b55d 100644
--- a/src/main/java/org/apache/datasketches/hive/hll/SketchToStringUDF.java
+++ b/src/main/java/org/apache/datasketches/hive/hll/SketchToStringUDF.java
@@ -28,7 +28,7 @@ import org.apache.hadoop.io.BytesWritable;
 @Description(
     name = "SketchToString",
     value = "_FUNC_(sketch)",
-    extended = "Returns an human-readable summary of a given HllSketch.")
+    extended = "Returns a human-readable summary of a given HllSketch.")
 @SuppressWarnings("javadoc")
 public class SketchToStringUDF extends UDF {
 
diff --git a/src/main/java/org/apache/datasketches/hive/hll/UnionSketchUDAF.java b/src/main/java/org/apache/datasketches/hive/hll/UnionSketchUDAF.java
index 6277a83..7563fc9 100644
--- a/src/main/java/org/apache/datasketches/hive/hll/UnionSketchUDAF.java
+++ b/src/main/java/org/apache/datasketches/hive/hll/UnionSketchUDAF.java
@@ -51,7 +51,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectIn
     + "> SELECT UnionSketch(sketch) FROM src;\n"
     + "The return value is a binary blob that can be operated on by other sketch related functions."
     + " The lgK parameter controls the sketch size and rlative error expected from the sketch."
-    + " It is optional an must be from 4 to 21. The default is 12, which is expected to yield errors"
+    + " It is optional and must be from 4 to 21. The default is 12, which is expected to yield errors"
     + " of roughly +-3% in the estimation of uniques with 95% confidence."
     + " The target type parameter is optional and must be 'HLL_4', 'HLL_6' or 'HLL_8'."
     + " The default is 'HLL_4'")
@@ -129,7 +129,7 @@ public class UnionSketchUDAF extends AbstractGenericUDAFResolver {
     public ObjectInspector init(final Mode mode, final ObjectInspector[] parameters) throws HiveException {
       super.init(mode, parameters);
 
-      if ((mode == Mode.PARTIAL1) || (mode == Mode.COMPLETE)) {
+      if (mode == Mode.PARTIAL1 || mode == Mode.COMPLETE) {
         inputInspector_ = (PrimitiveObjectInspector) parameters[0];
         if (parameters.length > 1) {
           lgKInspector_ = (PrimitiveObjectInspector) parameters[1];
@@ -142,7 +142,7 @@ public class UnionSketchUDAF extends AbstractGenericUDAFResolver {
         intermediateInspector_ = (StandardStructObjectInspector) parameters[0];
       }
 
-      if ((mode == Mode.PARTIAL1) || (mode == Mode.PARTIAL2)) {
+      if (mode == Mode.PARTIAL1 || mode == Mode.PARTIAL2) {
         // intermediate results need to include the lgK and the target HLL type
         return ObjectInspectorFactory.getStandardStructObjectInspector(
           Arrays.asList(LG_K_FIELD, HLL_TYPE_FIELD, SKETCH_FIELD),


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org