diff --git a/connector/src/main/java/io/pixelsdb/pixels/trino/PixelsPageSourceProvider.java b/connector/src/main/java/io/pixelsdb/pixels/trino/PixelsPageSourceProvider.java index a675cab..e57b74f 100644 --- a/connector/src/main/java/io/pixelsdb/pixels/trino/PixelsPageSourceProvider.java +++ b/connector/src/main/java/io/pixelsdb/pixels/trino/PixelsPageSourceProvider.java @@ -145,7 +145,14 @@ else if (config.getOutputScheme() == Storage.Scheme.redis) List withFilterColumns = getIncludeColumns(pixelsColumns, tableHandle); PixelsTransactionHandle transHandle = (PixelsTransactionHandle) transactionHandle; if (transHandle.getExecutorType() == QueryQueues.ExecutorType.Lambda && - this.localSplitCounter.get() >= config.getLocalScanConcurrency()) + this.localSplitCounter.get() >= config.getLocalScanConcurrency() + /** + * Issue #57: + * If the number of columns to read is 0, the spits should not be processed by Lambda. + * It usually means that the query is like select count(*) from table. + * Such queries can be served on the metadata headers that are cached locally, without touching the data. + */ + && !withFilterColumns.isEmpty()) { String[] columnsToRead = new String[withFilterColumns.size()]; boolean[] projection = new boolean[withFilterColumns.size()];