Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Issue #4]: support lambda worker outputs collection. #27

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package io.pixelsdb.pixels.trino;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.google.common.collect.ImmutableList;
import io.airlift.log.Logger;
import io.airlift.slice.Slice;
Expand Down Expand Up @@ -159,6 +160,22 @@ else if (tableHandle.getTableType() == PixelsTableHandle.TableType.JOINED)
logger.info("join operator: " + JSON.toJSONString(joinOperator));
joinOperator.executePrev();

Thread outputCollector = new Thread(() -> {
try
{
JoinOperator.OutputCollection outputCollection = joinOperator.collectOutputs();
SerializerFeature[] features = new SerializerFeature[]{SerializerFeature.WriteClassName};
String json = JSON.toJSONString(outputCollection, features);
logger.info("join outputs: " + json);
} catch (Exception e)
{
logger.error(e, "failed to execute the join plan using pixels-lambda");
throw new TrinoException(PixelsErrorCode.PIXELS_SQL_EXECUTE_ERROR,
"failed to execute the join plan using pixels-lambda");
}
});
outputCollector.start();

// Build the splits of the join result.
ImmutableList.Builder<PixelsSplit> splitsBuilder = ImmutableList.builder();
/*
Expand Down