Skip to content
Merged
Show file tree
Hide file tree
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 @@ -184,11 +184,7 @@ private static class WindowStartEndReturnTypeInference implements SqlReturnTypeI
public WindowStartEndReturnTypeInference() {}

public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
if (opBinding.getOperandType(0).getSqlTypeName().equals(SqlTypeName.TIMESTAMP)) {
return opBinding.getOperandType(0);
} else {
return explicit.inferReturnType(opBinding);
}
return explicit.inferReturnType(opBinding);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public PlannerWindowEnd(@JsonProperty(FIELD_NAME_REFERENCE) PlannerWindowReferen

@Override
public LogicalType getResultType() {
return new TimestampType(3);
return new TimestampType(false, 3);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PlannerWindowStart(

@Override
public LogicalType getResultType() {
return new TimestampType(3);
return new TimestampType(false, 3);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@
}, {
"w$start" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
}, {
"w$end" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
Expand Down Expand Up @@ -427,15 +427,15 @@
"inputIndex" : 5,
"type" : {
"typeName" : "TIMESTAMP",
"nullable" : true,
"nullable" : false,
"precision" : 3
}
}, {
"kind" : "INPUT_REF",
"inputIndex" : 6,
"type" : {
"typeName" : "TIMESTAMP",
"nullable" : true,
"nullable" : false,
"precision" : 3
}
}, {
Expand Down Expand Up @@ -485,14 +485,14 @@
}, {
"window_start" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
}, {
"window_end" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
Expand Down Expand Up @@ -550,14 +550,14 @@
}, {
"window_start" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
}, {
"window_end" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@
}, {
"w$start" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
}, {
"w$end" : {
"type" : "TIMESTAMP_WITHOUT_TIME_ZONE",
"nullable" : true,
"nullable" : false,
"precision" : 3,
"kind" : "REGULAR"
}
Expand All @@ -397,21 +397,8 @@
"nullable" : true
}
}, {
"kind" : "REX_CALL",
"operator" : {
"name" : "CAST",
"kind" : "CAST",
"syntax" : "SPECIAL"
},
"operands" : [ {
"kind" : "INPUT_REF",
"inputIndex" : 3,
"type" : {
"typeName" : "TIMESTAMP",
"nullable" : true,
"precision" : 3
}
} ],
"kind" : "INPUT_REF",
"inputIndex" : 3,
"type" : {
"typeName" : "TIMESTAMP",
"nullable" : false,
Expand Down Expand Up @@ -450,7 +437,7 @@
"EXPR$2" : "BIGINT NOT NULL"
} ]
},
"description" : "Calc(select=[b, CAST(w$end) AS window_end, EXPR$2])"
"description" : "Calc(select=[b, w$end AS window_end, EXPR$2])"
}, {
"class" : "org.apache.flink.table.planner.plan.nodes.exec.stream.StreamExecSink",
"dynamicTableSink" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ LogicalProject(name=[$0], EXPR$1=[TUMBLE_END($1)], EXPR$2=[$2])
</Resource>
<Resource name="optimized exec plan">
<![CDATA[
Calc(select=[name, CAST(w$end) AS EXPR$1, EXPR$2])
Calc(select=[name, w$end AS EXPR$1, EXPR$2])
+- GroupWindowAggregate(groupBy=[name], window=[TumblingGroupWindow('w$, proctime, 600000)], properties=[w$start, w$end, w$proctime], select=[name, AVG(val) AS EXPR$2, start('w$) AS w$start, end('w$) AS w$end, proctime('w$) AS w$proctime])
+- Exchange(distribution=[hash[name]])
+- Calc(select=[val, name, proctime], where=[(val > 100)])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ LogicalProject(symbol=[$0], price=[$2], rowTime=[TUMBLE_ROWTIME($1)], startTime=
</Resource>
<Resource name="optimized rel plan">
<![CDATA[
Calc(select=[symbol, price, CAST(w$rowtime) AS rowTime, CAST(w$start) AS startTime])
Calc(select=[symbol, price, CAST(w$rowtime) AS rowTime, w$start AS startTime])
+- GroupWindowAggregate(groupBy=[symbol], window=[TumblingGroupWindow('w$, matchRowtime, 3000)], properties=[w$start, w$end, w$rowtime, w$proctime], select=[symbol, SUM(price) AS price, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
+- Exchange(distribution=[hash[symbol]])
+- Calc(select=[symbol, matchRowtime, price])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ LogicalProject(EXPR$0=[$1], wAvg=[$2], EXPR$2=[HOP_START($0)], EXPR$3=[HOP_END($
</Resource>
<Resource name="optimized exec plan">
<![CDATA[
Calc(select=[EXPR$0, wAvg, CAST(w$start) AS EXPR$2, CAST(w$end) AS EXPR$3])
Calc(select=[EXPR$0, wAvg, w$start AS EXPR$2, w$end AS EXPR$3])
+- GroupWindowAggregate(window=[SlidingGroupWindow('w$, proctime, 3600000, 900000)], properties=[w$start, w$end, w$proctime], select=[COUNT(*) AS EXPR$0, weightedAvg(c, a) AS wAvg, start('w$) AS w$start, end('w$) AS w$end, proctime('w$) AS w$proctime])
+- Exchange(distribution=[single])
+- Calc(select=[proctime, c, CAST(a) AS a])
Expand Down Expand Up @@ -388,7 +388,7 @@ LogicalProject(EXPR$0=[$1], wAvg=[$2], EXPR$2=[SESSION_START($0)], EXPR$3=[SESSI
</Resource>
<Resource name="optimized exec plan">
<![CDATA[
Calc(select=[EXPR$0, wAvg, CAST(w$start) AS EXPR$2, CAST(w$end) AS EXPR$3])
Calc(select=[EXPR$0, wAvg, w$start AS EXPR$2, w$end AS EXPR$3])
+- GroupWindowAggregate(window=[SessionGroupWindow('w$, proctime, 900000)], properties=[w$start, w$end, w$proctime], select=[COUNT(*) AS EXPR$0, weightedAvg(c, a) AS wAvg, start('w$) AS w$start, end('w$) AS w$end, proctime('w$) AS w$proctime])
+- Exchange(distribution=[single])
+- Calc(select=[proctime, c, CAST(a) AS a])
Expand Down