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

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 129584c6376 HIVE-27599: ConvertAstToSearchArg improvement with output 
and typo in comments (#4578). (xy, reviewed by Ayush Saxena)
129584c6376 is described below

commit 129584c6376f33214f115048333a4b5c96b944cb
Author: xuzifu666 <[email protected]>
AuthorDate: Sat Aug 26 14:38:37 2023 +0800

    HIVE-27599: ConvertAstToSearchArg improvement with output and typo in 
comments (#4578). (xy, reviewed by Ayush Saxena)
---
 .../hadoop/hive/ql/io/sarg/ConvertAstToSearchArg.java      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/io/sarg/ConvertAstToSearchArg.java 
b/ql/src/java/org/apache/hadoop/hive/ql/io/sarg/ConvertAstToSearchArg.java
index d9d3ef653d9..0de48cca843 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/sarg/ConvertAstToSearchArg.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/sarg/ConvertAstToSearchArg.java
@@ -279,7 +279,7 @@ public class ConvertAstToSearchArg {
   /**
    * Return the boxed literal at the given position
    * @param expr the parent node
-   * @param type the type of the expression
+   * @param boxType the type of the expression
    * @param position the child position to check
    * @return the boxed literal if found otherwise null
    */
@@ -583,12 +583,12 @@ public class ConvertAstToSearchArg {
   }
 
   public static String sargToKryo(SearchArgument sarg) {
-    Output out = new Output(KRYO_OUTPUT_BUFFER_SIZE, 
KRYO_OUTPUT_BUFFER_MAX_SIZE);
-    Kryo kryo = SerializationUtilities.borrowKryo();
-    kryo.writeObject(out, sarg);
-    out.close();
-    SerializationUtilities.releaseKryo(kryo);
-    return Base64.encodeBase64String(out.toBytes());
+    try (Output out = new Output(KRYO_OUTPUT_BUFFER_SIZE, 
KRYO_OUTPUT_BUFFER_MAX_SIZE)) {
+      Kryo kryo = SerializationUtilities.borrowKryo();
+      kryo.writeObject(out, sarg);
+      SerializationUtilities.releaseKryo(kryo);
+      return Base64.encodeBase64String(out.toBytes());
+    }
   }
 
 }

Reply via email to