You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/08/06 10:14:21 UTC
[GitHub] [flink] paul8263 opened a new pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
paul8263 opened a new pull request #16740:
URL: https://github.com/apache/flink/pull/16740
… ...) is not correct
## What is the purpose of the change
Fixe the issue that the resulting scale of TRUNCATE(DECIMAL, ...) is not correct.
## Brief change log
- flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/MathFunctionsITCase.java
- flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
## Verifying this change
This change added tests and can be verified as follows:
- Added truncate decimal test case in flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/MathFunctionsITCase.java
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* d7e70d63f6b2b0e498db3b9d602acf580770030f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896)
* 56b337596cb3b2db4fe3d4aa985b4ce8851102ba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tsreaper commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
tsreaper commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r685739913
##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -224,6 +224,15 @@ public void lookupOperatorOverloads(
OperandTypes.or(OperandTypes.NUMERIC_INTEGER, OperandTypes.NUMERIC),
SqlFunctionCategory.NUMERIC);
+ public static final SqlFunction TRUNCATE =
+ new SqlFunction(
+ "TRUNCATE",
+ SqlKind.OTHER_FUNCTION,
+ FlinkReturnTypes.ROUND_FUNCTION_NULLABLE,
Review comment:
I would prefer "ROUNDING_NULLABLE", as "rounding" is a more general behavior (we can round down or round up), not specified to a function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "",
"status" : "CANCELED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* Unknown: [CANCELED](TBD)
* ae3ae37c52e99c8ab1f294545445038b4e469e0d UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tsreaper commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
tsreaper commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-899996370
Hi @paul8263 , this PR is conflicting with the master branch. Please resolve the conflicts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
}, {
"hash" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425",
"triggerID" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 56b337596cb3b2db4fe3d4aa985b4ce8851102ba Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956)
* 9296b4edc8df450cdace492e137e58a1dba609c4 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tsreaper commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
tsreaper commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r685739913
##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -224,6 +224,15 @@ public void lookupOperatorOverloads(
OperandTypes.or(OperandTypes.NUMERIC_INTEGER, OperandTypes.NUMERIC),
SqlFunctionCategory.NUMERIC);
+ public static final SqlFunction TRUNCATE =
+ new SqlFunction(
+ "TRUNCATE",
+ SqlKind.OTHER_FUNCTION,
+ FlinkReturnTypes.ROUND_FUNCTION_NULLABLE,
Review comment:
I would prefer "ROUNDING_NULLABLE", as "rounding" is a more general behavior, not specified to a function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* aceb2a25e00797b20ed5e3356f168ea12df0a8de Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 removed a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 removed a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-900766636
Hi @tsreaper ,
I solved the conflicts in 9296b4e.
When I ran the unit tests I encountered an error: org.apache.flink.changelog.fs.FsStateChangelogStorageFactory in org.apache.flink.changelog.fs is not public, cannot access it from external packages.
In FLINK-23279, org.apache.flink.changelog.fs.FsStateChangelogStorageFactory was added in StreamFaultToleranceTestBase.java. It seems that changes in other commits might lead to the test failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
}, {
"hash" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425",
"triggerID" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"triggerType" : "PUSH"
}, {
"hash" : "4a1e653e3c77d1bc2792c28c0454d4556c6d403d",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23645",
"triggerID" : "4a1e653e3c77d1bc2792c28c0454d4556c6d403d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 9296b4edc8df450cdace492e137e58a1dba609c4 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425)
* 4a1e653e3c77d1bc2792c28c0454d4556c6d403d Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23645)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* aceb2a25e00797b20ed5e3356f168ea12df0a8de UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 removed a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 removed a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-900766636
Hi @tsreaper ,
I solved the conflicts in 9296b4e.
When I ran the unit tests I encountered an error: org.apache.flink.changelog.fs.FsStateChangelogStorageFactory in org.apache.flink.changelog.fs is not public, cannot access it from external packages.
In FLINK-23279, org.apache.flink.changelog.fs.FsStateChangelogStorageFactory was added in StreamFaultToleranceTestBase.java. It seems that changes in other commits might lead to the test failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
}, {
"hash" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425",
"triggerID" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 9296b4edc8df450cdace492e137e58a1dba609c4 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* aceb2a25e00797b20ed5e3356f168ea12df0a8de Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687)
* c084abda71df7c5e1b0118dcbbd8761f89691526 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tsreaper commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
tsreaper commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r685729824
##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/MathFunctionsITCase.java
##########
@@ -115,6 +115,14 @@
$("f0").round(2),
"ROUND(f0, 2)",
new BigDecimal("12345.12"),
- DataTypes.DECIMAL(8, 2).notNull()));
+ DataTypes.DECIMAL(8, 2).notNull()),
+ TestSpec.forFunction(BuiltInFunctionDefinitions.TRUNCATE)
+ .onFieldsWithData(new BigDecimal("123.456"))
+ // TRUNCATE(DECIMAL(6, 3) NOT NULL, 2) => DECIMAL(6, 2) NOT NULL
+ .testResult(
+ $("f0").truncate(2),
+ "TRUNCATE(f0, 2)",
+ new BigDecimal("123.45"),
+ DataTypes.DECIMAL(6, 2).notNull()));
Review comment:
Nice catch. With this in mind we shall keep using `FlinkReturnTypes.ROUND_FUNCTION_NULLABLE` instead of modifying it. Still the test cases should be moved to the appropriate place. You can also add this special "truncate to zero" test case in your test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894160646
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit aceb2a25e00797b20ed5e3356f168ea12df0a8de (Fri Aug 06 10:17:54 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* ae3ae37c52e99c8ab1f294545445038b4e469e0d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813)
* d7e70d63f6b2b0e498db3b9d602acf580770030f UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 56b337596cb3b2db4fe3d4aa985b4ce8851102ba Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* ae3ae37c52e99c8ab1f294545445038b4e469e0d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* aceb2a25e00797b20ed5e3356f168ea12df0a8de Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* d7e70d63f6b2b0e498db3b9d602acf580770030f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896)
* 56b337596cb3b2db4fe3d4aa985b4ce8851102ba UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
}, {
"hash" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425",
"triggerID" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"triggerType" : "PUSH"
}, {
"hash" : "4a1e653e3c77d1bc2792c28c0454d4556c6d403d",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23645",
"triggerID" : "4a1e653e3c77d1bc2792c28c0454d4556c6d403d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4a1e653e3c77d1bc2792c28c0454d4556c6d403d Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=23645)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "CANCELED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* Unknown: [CANCELED](TBD)
* ae3ae37c52e99c8ab1f294545445038b4e469e0d Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* c084abda71df7c5e1b0118dcbbd8761f89691526 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-900766227
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r685791988
##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/MathFunctionsITCase.java
##########
@@ -115,6 +115,14 @@
$("f0").round(2),
"ROUND(f0, 2)",
new BigDecimal("12345.12"),
- DataTypes.DECIMAL(8, 2).notNull()));
+ DataTypes.DECIMAL(8, 2).notNull()),
+ TestSpec.forFunction(BuiltInFunctionDefinitions.TRUNCATE)
+ .onFieldsWithData(new BigDecimal("123.456"))
+ // TRUNCATE(DECIMAL(6, 3) NOT NULL, 2) => DECIMAL(6, 2) NOT NULL
+ .testResult(
+ $("f0").truncate(2),
+ "TRUNCATE(f0, 2)",
+ new BigDecimal("123.45"),
+ DataTypes.DECIMAL(6, 2).notNull()));
Review comment:
Hi @tsreaper ,
I added several "truncated to zero" test cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* ae3ae37c52e99c8ab1f294545445038b4e469e0d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813)
* d7e70d63f6b2b0e498db3b9d602acf580770030f Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* aceb2a25e00797b20ed5e3356f168ea12df0a8de Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687)
* c084abda71df7c5e1b0118dcbbd8761f89691526 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tsreaper commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
tsreaper commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r684875945
##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -224,6 +224,15 @@ public void lookupOperatorOverloads(
OperandTypes.or(OperandTypes.NUMERIC_INTEGER, OperandTypes.NUMERIC),
SqlFunctionCategory.NUMERIC);
+ public static final SqlFunction TRUNCATE =
+ new SqlFunction(
+ "TRUNCATE",
+ SqlKind.OTHER_FUNCTION,
+ FlinkReturnTypes.ROUND_FUNCTION_NULLABLE,
Review comment:
If you look into this method you'll find that it is calling `LogicalTypeMerging#findRoundDecimalType`. In that method there is a line stating that
```java
// NOTE: rounding may increase the digits by 1, therefore we need +1 on precisions.
return new DecimalType(false, 1 + precision - scale + round, round);
```
However for `truncate` function the number of digits will not increase, thus `FlinkReturnTypes.ROUND_FUNCTION_NULLABLE` is not the best choice to use here.
What I'll suggest is that you create a new method in `LogicalTypeMerging` called `findTruncateDecimalType`. This method and `findRoundDecimalType` can together reuse some code. Then you might want to create `FlinkReturnTypes.TRUNCATE_FUNCTION_NULLABLE` which will also reuse a lot of code with `ROUND_FUNCTION_NULLABLE`.
##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/MathFunctionsITCase.java
##########
@@ -115,6 +115,14 @@
$("f0").round(2),
"ROUND(f0, 2)",
new BigDecimal("12345.12"),
- DataTypes.DECIMAL(8, 2).notNull()));
+ DataTypes.DECIMAL(8, 2).notNull()),
+ TestSpec.forFunction(BuiltInFunctionDefinitions.TRUNCATE)
+ .onFieldsWithData(new BigDecimal("123.456"))
+ // TRUNCATE(DECIMAL(6, 3) NOT NULL, 2) => DECIMAL(6, 2) NOT NULL
+ .testResult(
+ $("f0").truncate(2),
+ "TRUNCATE(f0, 2)",
+ new BigDecimal("123.45"),
+ DataTypes.DECIMAL(6, 2).notNull()));
Review comment:
This `MathFunctionITCase`, as stated in the java docs, is for `BuiltInFunctionDefinitions`. If you follow the usage of `BuiltinFunctionDefinitions` you'll see that it is converted to `FlinkSqlOperatorTable.TRUNCATE`. For Flink SQL scalar functions we always add tests in `ScalarFunctionsTest`. Please add your tests there.
A thorough test for a function should include all data types it supported as well as their corresponding null values. The tests in `ScalarFunctionTest#testTruncate` may not be complete so please complete them with all supported data types. See `FlinkSqlOperatorTable.TRUNCATE` to get all its supported types.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r685736725
##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -224,6 +224,15 @@ public void lookupOperatorOverloads(
OperandTypes.or(OperandTypes.NUMERIC_INTEGER, OperandTypes.NUMERIC),
SqlFunctionCategory.NUMERIC);
+ public static final SqlFunction TRUNCATE =
+ new SqlFunction(
+ "TRUNCATE",
+ SqlKind.OTHER_FUNCTION,
+ FlinkReturnTypes.ROUND_FUNCTION_NULLABLE,
Review comment:
According to the second review request below, if round and truncate could use the same logic, could I refactor those method name to things like 'findRoundOrTruncateDecimalType'?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r685726680
##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/MathFunctionsITCase.java
##########
@@ -115,6 +115,14 @@
$("f0").round(2),
"ROUND(f0, 2)",
new BigDecimal("12345.12"),
- DataTypes.DECIMAL(8, 2).notNull()));
+ DataTypes.DECIMAL(8, 2).notNull()),
+ TestSpec.forFunction(BuiltInFunctionDefinitions.TRUNCATE)
+ .onFieldsWithData(new BigDecimal("123.456"))
+ // TRUNCATE(DECIMAL(6, 3) NOT NULL, 2) => DECIMAL(6, 2) NOT NULL
+ .testResult(
+ $("f0").truncate(2),
+ "TRUNCATE(f0, 2)",
+ new BigDecimal("123.45"),
+ DataTypes.DECIMAL(6, 2).notNull()));
Review comment:
Hi @tsreaper ,
Thank you for your advice.
In `flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java` there is an implementation of truncating method designed for `DecimalData`:
```
public static DecimalData struncate(DecimalData b0, int b1) {
if (b1 >= b0.scale()) {
return b0;
}
BigDecimal b2 =
b0.toBigDecimal()
.movePointRight(b1)
.setScale(0, RoundingMode.DOWN)
.movePointLeft(b1);
int p = b0.precision();
int s = b0.scale();
if (b1 < 0) {
return DecimalData.fromBigDecimal(b2, Math.min(38, 1 + p - s), 0);
} else {
return DecimalData.fromBigDecimal(b2, 1 + p - s + b1, b1);
}
}
```
It uses the same logic as the round method.
After I thought over this issue, I suggest that we should add 1 on precision (same logic as round method). If we did not do that, for example, given a number f1 0.333 with the type of DECIMAL(3, 3), if we call truncate(f1, 0), the precision of the result would be 0, which would trigger an exception of 'Decimal precision must be between 1 and 38 (both inclusive)'.
Those info above is my point of view. If you have any suggestion, please comment below. Thanks a lot.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-895820166
@flinkbot run azure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-900766636
Hi @tsreaper ,
I solved the conflicts in 9296b4e.
When I ran the unit tests I encountered an error: org.apache.flink.changelog.fs.FsStateChangelogStorageFactory in org.apache.flink.changelog.fs is not public, cannot access it from external packages.
In FLINK-23279, org.apache.flink.changelog.fs.FsStateChangelogStorageFactory was added in StreamFaultToleranceTestBase.java. It seems that changes in other commits might lead to the test failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] Airblader commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
Airblader commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r684131270
##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -224,6 +224,15 @@ public void lookupOperatorOverloads(
OperandTypes.or(OperandTypes.NUMERIC_INTEGER, OperandTypes.NUMERIC),
SqlFunctionCategory.NUMERIC);
+ public static final SqlFunction TRUNCATE =
+ new SqlFunction(
+ "TRUNCATE",
+ SqlKind.OTHER_FUNCTION,
+ FlinkReturnTypes.ROUND_FUNCTION_NULLABLE,
Review comment:
If we're reusing this strategy, the name doesn't seem appropriate anymore. We should rename this to something that explains what it's doing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on a change in pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on a change in pull request #16740:
URL: https://github.com/apache/flink/pull/16740#discussion_r685794542
##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -224,6 +224,15 @@ public void lookupOperatorOverloads(
OperandTypes.or(OperandTypes.NUMERIC_INTEGER, OperandTypes.NUMERIC),
SqlFunctionCategory.NUMERIC);
+ public static final SqlFunction TRUNCATE =
+ new SqlFunction(
+ "TRUNCATE",
+ SqlKind.OTHER_FUNCTION,
+ FlinkReturnTypes.ROUND_FUNCTION_NULLABLE,
Review comment:
OK. I'll keep it the same as the round method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
}, {
"hash" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 56b337596cb3b2db4fe3d4aa985b4ce8851102ba Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956)
* 9296b4edc8df450cdace492e137e58a1dba609c4 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] paul8263 commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
paul8263 commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-900766227
Hi @tsreaper ,
I solved the conflicts in 9296b4e.
When I ran the unit tests I encountered an error: org.apache.flink.changelog.fs.FsStateChangelogStorageFactory in org.apache.flink.changelog.fs is not public, cannot access it from external packages.
In FLINK-23279, org.apache.flink.changelog.fs.FsStateChangelogStorageFactory was added in StreamFaultToleranceTestBase.java. It seems that changes in other commits might lead to the test failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JingsongLi merged pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
JingsongLi merged pull request #16740:
URL: https://github.com/apache/flink/pull/16740
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
}, {
"hash" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21956",
"triggerID" : "56b337596cb3b2db4fe3d4aa985b4ce8851102ba",
"triggerType" : "PUSH"
}, {
"hash" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425",
"triggerID" : "9296b4edc8df450cdace492e137e58a1dba609c4",
"triggerType" : "PUSH"
}, {
"hash" : "4a1e653e3c77d1bc2792c28c0454d4556c6d403d",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "4a1e653e3c77d1bc2792c28c0454d4556c6d403d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 9296b4edc8df450cdace492e137e58a1dba609c4 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22425)
* 4a1e653e3c77d1bc2792c28c0454d4556c6d403d UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tsreaper commented on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
tsreaper commented on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-896465161
I've checked this issue again and found that adding tests to `ScalarFunctionsTest.scala` is not enough. This is because function test use the generated function code directly and will not check for the return type of the function. So you may also need to add some tests in `org.apache.flink.table.planner.runtime.batch.sql.CalcITCase`.
Also there are CI failures. Please keep an eye on the comment of @flinkbot for the results. If there are CI failures then the PR will never be merged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #16740: [FLINK-23614][table-planner] The resulting scale of TRUNCATE(DECIMAL,…
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16740:
URL: https://github.com/apache/flink/pull/16740#issuecomment-894176423
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21687",
"triggerID" : "aceb2a25e00797b20ed5e3356f168ea12df0a8de",
"triggerType" : "PUSH"
}, {
"hash" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21745",
"triggerID" : "c084abda71df7c5e1b0118dcbbd8761f89691526",
"triggerType" : "PUSH"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21813",
"triggerID" : "ae3ae37c52e99c8ab1f294545445038b4e469e0d",
"triggerType" : "PUSH"
}, {
"hash" : "",
"status" : "DELETED",
"url" : "TBD",
"triggerID" : "895820166",
"triggerType" : "MANUAL"
}, {
"hash" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896",
"triggerID" : "d7e70d63f6b2b0e498db3b9d602acf580770030f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* d7e70d63f6b2b0e498db3b9d602acf580770030f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=21896)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org