Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Kwok <[email protected]>
  • Loading branch information
andy-k-improving committed Feb 14, 2025
1 parent 6037742 commit e590fb9
Showing 1 changed file with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ static Stream<Arguments> supportedDataTypes() {

static Stream<Arguments> unSupportedDataTypes() {
return Stream.of(SMA, WMA)
.flatMap(
trendlineType ->
Stream.of(
Arguments.of(trendlineType, ExprCoreType.UNDEFINED),
Arguments.of(trendlineType, ExprCoreType.BYTE),
Arguments.of(trendlineType, ExprCoreType.STRING),
Arguments.of(trendlineType, ExprCoreType.BOOLEAN),
Arguments.of(trendlineType, ExprCoreType.INTERVAL),
Arguments.of(trendlineType, ExprCoreType.IP),
Arguments.of(trendlineType, ExprCoreType.STRUCT),
Arguments.of(trendlineType, ExprCoreType.ARRAY)));
.flatMap(
trendlineType ->
Stream.of(
Arguments.of(trendlineType, ExprCoreType.UNDEFINED),
Arguments.of(trendlineType, ExprCoreType.BYTE),
Arguments.of(trendlineType, ExprCoreType.STRING),
Arguments.of(trendlineType, ExprCoreType.BOOLEAN),
Arguments.of(trendlineType, ExprCoreType.INTERVAL),
Arguments.of(trendlineType, ExprCoreType.IP),
Arguments.of(trendlineType, ExprCoreType.STRUCT),
Arguments.of(trendlineType, ExprCoreType.ARRAY)));
}

static Stream<Arguments> invalidArguments() {
Expand Down Expand Up @@ -716,16 +716,17 @@ public void trendLine_dataType_support_wma(ExprCoreType supportedType) {
@ParameterizedTest
@MethodSource("unSupportedDataTypes")
public void trendLine_unsupported_dataType(
Trendline.TrendlineType trendlineType, ExprCoreType dataType) {
Trendline.TrendlineType trendlineType, ExprCoreType dataType) {
assertThrows(
SemanticCheckException.class,
() ->
new TrendlineOperator(
inputPlan,
Collections.singletonList(
Pair.of(
AstDSL.computation(2, AstDSL.field("distance"),
"distance_alias", trendlineType), dataType))));
SemanticCheckException.class,
() ->
new TrendlineOperator(
inputPlan,
Collections.singletonList(
Pair.of(
AstDSL.computation(
2, AstDSL.field("distance"), "distance_alias", trendlineType),
dataType))));
}

@ParameterizedTest
Expand All @@ -748,8 +749,6 @@ public void use_invalid_configuration(
"Unsupported arguments: " + errorMessage);
}



private void mockPlanWithData(List<ExprValue> inputs) {
List<Boolean> hasNextElements = new ArrayList<>(Collections.nCopies(inputs.size(), true));
hasNextElements.add(false);
Expand Down

0 comments on commit e590fb9

Please sign in to comment.