You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "hqx871 (via GitHub)" <gi...@apache.org> on 2023/02/04 02:04:58 UTC

[GitHub] [druid] hqx871 commented on a diff in pull request #13303: Hadoop based batch ingestion support range partition

hqx871 commented on code in PR #13303:
URL: https://github.com/apache/druid/pull/13303#discussion_r1096458943


##########
indexing-hadoop/src/main/java/org/apache/druid/indexer/DeterminePartitionsJob.java:
##########
@@ -346,10 +361,14 @@ protected void innerMap(
           rollupGranularity.bucketStart(inputRow.getTimestamp()).getMillis(),
           inputRow
       );
-      context.write(
-          new BytesWritable(HadoopDruidIndexerConfig.JSON_MAPPER.writeValueAsBytes(groupKey)),
-          NullWritable.get()
-      );
+
+      final byte[] bytes = HadoopDruidIndexerConfig.JSON_MAPPER.writeValueAsBytes(groupKey);
+      if (sample <= 1 || Math.abs(HASH_FUNCTION.hashBytes(bytes).asInt()) % sample == 0) {

Review Comment:
   Yes, we only need to emit certain group keys. 



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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