Skip to content

Commit

Permalink
[Issue #57]: avoid invoking Lambda for select count(*). (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
bianhq authored Feb 12, 2023
1 parent 7482370 commit 47e8f73
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@ else if (config.getOutputScheme() == Storage.Scheme.redis)
List<PixelsColumnHandle> 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()];
Expand Down

0 comments on commit 47e8f73

Please # to comment.