You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/08/11 04:16:31 UTC
[GitHub] [iotdb] xinzhongtianxia opened a new pull request #3719: [IOTDB-jira 1539] The delete operation is incorrect
xinzhongtianxia opened a new pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719
## Description
https://issues.apache.org/jira/browse/IOTDB-1539
For now, deletion do not support values filter, but, all conditions in where clause will be treated as time condition, thus will product two affects:
1. If the data type in condition could be parsed to Long, the statement will be executed successfully, it's dangerous!!
For example, the original statement is "delete from root.vehicle.d1.s1 where s1 > 100", but the actually statement be
executed is "delete from root.vehicle.d1.s1 where time > 100". Then, data may be deleted abnormally.
2. If the data type in condition could not be parsed to Long, we will get a 500 error because of a NumberFormatException.
## Solution
Before the value filter feature is implemented, I temporally fixed this by return an error message like "For delete statement, where clause can only contain time expressions, value filter is not currently supported." if any non-time-expression appears in where clause.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] wangchao316 commented on pull request #3719: [IOTDB-1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
wangchao316 commented on pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#issuecomment-899165076
after this pr merged, you need cherry pick 0.12-branch.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] HTHou commented on pull request #3719: [IOTDB-1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
HTHou commented on pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#issuecomment-899165906
> after this pr merged, you need cherry pick 0.12-branch.
Let me do it.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls edited a comment on pull request #3719: [IOTDB-1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#issuecomment-896508828
[](https://coveralls.io/builds/42055474)
Coverage decreased (-0.02%) to 67.228% when pulling **1df9f3d6f04912dd5b20a6ca368186e7bbd1e86a on xinzhongtianxia:jira_1539_delete_by_measurement_0810** into **c5bf93a9ee773ad9711bc1d08ea44b043f974b55 on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] wangchao316 commented on a change in pull request #3719: [IOTDB-1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
wangchao316 commented on a change in pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#discussion_r686538933
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
##########
@@ -73,6 +74,73 @@ public void tearDown() throws Exception {
IoTDBDescriptor.getInstance().getConfig().setPartitionInterval(prevPartitionInterval);
}
+ /**
+ * Should delete this case after the deletion value filter feature be implemented
+ *
+ * @throws SQLException
+ */
+ @Test
+ public void testUnsupportedValueFilter() throws SQLException {
+ try (Connection connection =
+ DriverManager.getConnection(
+ Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
+ Statement statement = connection.createStatement()) {
+
+ statement.execute("insert into root.vehicle.d0(time,s0) values (10,310)");
+ statement.execute("insert into root.vehicle.d0(time,s3) values (10,'text')");
+ statement.execute("insert into root.vehicle.d0(time,s4) values (10,true)");
+
+ String errorMsg =
+ "303: Check metadata error: For delete statement, where clause can only"
+ + " contain time expressions, value filter is not currently supported.";
+
+ try {
+ statement.execute("DELETE FROM root.vehicle.d0.s0 WHERE s0 <= 300 AND s0 > 0");
Review comment:
hi, add a test case, DELETE FROM root.vehicle.d0.s0 WHERE s0 <= 300 and time > *** and time < ***.
what will this situation return ?
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls commented on pull request #3719: [IOTDB-jira 1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#issuecomment-896508828
[](https://coveralls.io/builds/42053514)
Coverage decreased (-0.01%) to 67.239% when pulling **627f6a91dcbbaf57ff068281c2b497a703bcefd4 on xinzhongtianxia:jira_1539_delete_by_measurement_0810** into **c5bf93a9ee773ad9711bc1d08ea44b043f974b55 on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls edited a comment on pull request #3719: [IOTDB-1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#issuecomment-896508828
[](https://coveralls.io/builds/42084949)
Coverage increased (+0.02%) to 67.275% when pulling **36472ca48dffc5a950b950c9eff50663c569273d on xinzhongtianxia:jira_1539_delete_by_measurement_0810** into **c5bf93a9ee773ad9711bc1d08ea44b043f974b55 on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] HTHou merged pull request #3719: [IOTDB-1539] Fix delete operation with value filter is abnormal
Posted by GitBox <gi...@apache.org>.
HTHou merged pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] xinzhongtianxia commented on a change in pull request #3719: [IOTDB-1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
xinzhongtianxia commented on a change in pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#discussion_r686549825
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
##########
@@ -73,6 +74,73 @@ public void tearDown() throws Exception {
IoTDBDescriptor.getInstance().getConfig().setPartitionInterval(prevPartitionInterval);
}
+ /**
+ * Should delete this case after the deletion value filter feature be implemented
+ *
+ * @throws SQLException
+ */
+ @Test
+ public void testUnsupportedValueFilter() throws SQLException {
+ try (Connection connection =
+ DriverManager.getConnection(
+ Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
+ Statement statement = connection.createStatement()) {
+
+ statement.execute("insert into root.vehicle.d0(time,s0) values (10,310)");
+ statement.execute("insert into root.vehicle.d0(time,s3) values (10,'text')");
+ statement.execute("insert into root.vehicle.d0(time,s4) values (10,true)");
+
+ String errorMsg =
+ "303: Check metadata error: For delete statement, where clause can only"
+ + " contain time expressions, value filter is not currently supported.";
+
+ try {
+ statement.execute("DELETE FROM root.vehicle.d0.s0 WHERE s0 <= 300 AND s0 > 0");
Review comment:
It will return"For delete statement, where clause can only contain atomic expressions like : time > XXX, time <= XXX, or two atomic expressions connected by 'AND'"
In situations expressions number more than 2, will always return this message.
Related code:
> List<FilterOperator> children = filterOperator.getChildren();
FilterOperator lOperator = children.get(0);
FilterOperator rOperator = children.get(1);
if (!lOperator.isLeaf() || !rOperator.isLeaf()) {
throw new SQLParserException(DELETE_RANGE_ERROR_MSG);
}
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] wangchao316 commented on pull request #3719: [IOTDB-1539] The delete operation is incorrect
Posted by GitBox <gi...@apache.org>.
wangchao316 commented on pull request #3719:
URL: https://github.com/apache/iotdb/pull/3719#issuecomment-896540499
Good Job
Thanks for your contribution.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org