siddharthteotia commented on code in PR #9064: URL: https://github.com/apache/pinot/pull/9064#discussion_r927806617
########## pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/QueryRunner.java: ########## @@ -101,25 +107,72 @@ public void processQuery(DistributedStagePlan distributedStagePlan, ExecutorServ BaseDataBlock dataBlock; try { DataTable dataTable = _serverExecutor.processQuery(serverQueryRequest, executorService, null); - // this works because default DataTableImplV3 will have a version number at beginning, - // which maps to ROW type of version 3. - dataBlock = DataBlockUtils.getDataBlock(ByteBuffer.wrap(dataTable.toBytes())); + if (!dataTable.getExceptions().isEmpty()) { + // if contains exception, directly return a metadata block with the exceptions. + dataBlock = DataBlockUtils.getErrorDataBlock(dataTable.getExceptions()); + } else { + // this works because default DataTableImplV3 will have a version number at beginning: + // the new DataBlock encodes lower 16 bites as version and upper 16 bites as type (ROW, COLUMNAR, METADATA) Review Comment: (nit) s/bites/bits ? -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org