Skip to content

Commit

Permalink
Filter "Specify copies" GuiAction if transform doesn't support it apa…
Browse files Browse the repository at this point in the history
…che#3439

Disable multi-copy execution support for 4 transforms:
- Abort
- Analytic query
- Group by
- Memory group by
  • Loading branch information
nadment committed Nov 22, 2023
1 parent 3b86ac2 commit 62c07ca
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ public boolean supportsErrorHandling() {
return false;
}

@Override
public boolean supportsMultiCopyExecution() {
return true;
}

/** This method is added to exclude certain transforms from layout checking. */
public boolean excludeFromRowLayoutVerification() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ SqlStatement getSqlStatements(
*/
boolean supportsErrorHandling();

/**
* @return true if this transform supports multi-copies execution. By default return true.
*/
boolean supportsMultiCopyExecution();

/**
* Get a list of all the resource dependencies that the transform is depending on.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,10 @@ public static final TransformMeta findTransform(
return null;
}

public boolean supportsMultiCopyExecution() {
return transform.supportsMultiCopyExecution();
}

public boolean supportsErrorHandling() {
return transform.supportsErrorHandling();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,9 @@ public AbortOption getAbortOption() {
public void setAbortOption(AbortOption abortOption) {
this.abortOption = abortOption;
}

@Override
public boolean supportsMultiCopyExecution() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,9 @@ public List<QueryField> getQueryFields() {
public void setQueryFields(List<QueryField> queryFields) {
this.queryFields = queryFields;
}

@Override
public boolean supportsMultiCopyExecution() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,9 @@ public List<Aggregation> getAggregations() {
public void setAggregations(List<Aggregation> aggregations) {
this.aggregations = aggregations;
}

@Override
public boolean supportsMultiCopyExecution() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,9 @@ public boolean isAlwaysGivingBackOneRow() {
public void setAlwaysGivingBackOneRow(boolean alwaysGivingBackOneRow) {
this.alwaysGivingBackOneRow = alwaysGivingBackOneRow;
}

@Override
public boolean supportsMultiCopyExecution() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ public class HopGuiPipelineGraph extends HopGuiAbstractGraph
"pipeline-graph-transform-10650-rows-copy";
public static final String ACTION_ID_PIPELINE_GRAPH_TRANSFORM_ROWS_DISTRIBUTE =
"pipeline-graph-transform-10600-rows-distribute";
public static final String ACTION_ID_PIPELINE_GRAPH_TRANSFORM_SPECIFY_COPIES =
"pipeline-graph-transform-10100-copies";
public static final String ACTION_ID_PIPELINE_GRAPH_TRANSFORM_ERROR_HANDLING =
"pipeline-graph-transform-10800-error-handling";
public static final String ACTION_ID_PIPELINE_GRAPH_TRANSFORM_VIEW_EXECUTION_INFO =
Expand Down Expand Up @@ -2279,7 +2281,7 @@ public IRowDistribution askUserForCustomDistributionMethod() {
}

@GuiContextAction(
id = "pipeline-graph-transform-10100-copies",
id = ACTION_ID_PIPELINE_GRAPH_TRANSFORM_SPECIFY_COPIES,
parentId = HopGuiPipelineTransformContext.CONTEXT_ID,
type = GuiActionType.Modify,
name = "i18n::HopGuiPipelineGraph.TransformAction.SpecifyCopies.Name",
Expand Down Expand Up @@ -2441,6 +2443,9 @@ public boolean filterTransformActions(
if (contextActionId.equals(ACTION_ID_PIPELINE_GRAPH_TRANSFORM_ROWS_COPY)) {
return context.getTransformMeta().isDistributes();
}
if (contextActionId.equals(ACTION_ID_PIPELINE_GRAPH_TRANSFORM_SPECIFY_COPIES)) {
return context.getTransformMeta().supportsMultiCopyExecution();
}
if (contextActionId.equals(ACTION_ID_PIPELINE_GRAPH_TRANSFORM_ERROR_HANDLING)) {
return context.getTransformMeta().supportsErrorHandling();
}
Expand Down

0 comments on commit 62c07ca

Please sign in to comment.