You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/08/25 08:17:21 UTC

[GitHub] [hive] kgyrtkirk commented on a change in pull request #1423: HIVE-24065: Bloom filters can be cached after deserialization in VectorInBloomFilterColDynamicValue

kgyrtkirk commented on a change in pull request #1423:
URL: https://github.com/apache/hive/pull/1423#discussion_r476264312



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorInBloomFilterColDynamicValue.java
##########
@@ -100,26 +103,39 @@ public void init(Configuration conf) {
     default:
       throw new IllegalStateException("Unsupported type " + colVectorType);
     }
+
+    String queryId = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEQUERYID);
+    runtimeCache = ObjectCacheFactory.getCache(conf, queryId, false, true);
   }
 
-  private void initValue()  {
-    InputStream in = null;
+  private void initValue() {
     try {
-      Object val = bloomFilterDynamicValue.getValue();
-      if (val != null) {
-        BinaryObjectInspector boi = (BinaryObjectInspector) bloomFilterDynamicValue.getObjectInspector();
-        byte[] bytes = boi.getPrimitiveJavaObject(val);
-        in = new NonSyncByteArrayInputStream(bytes);
-        bloomFilter = BloomKFilter.deserialize(in);
-      } else {
-        bloomFilter = null;
-      }
-      initialized = true;
-    } catch (Exception err) {
-      throw new RuntimeException(err);
-    } finally {
-      IOUtils.closeStream(in);

Review comment:
       I don't see this close in the new implementation...isn't that needed?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org