backtick escape character handled inconsistently by CLI and Java API when create timeseries
See original GitHub issueI created TIMESERIES like this using the session.createTimeseries()
IoTDB> SHOW TIMESERIES
+--------------------------------------------------------------------------------------------------------------------------------------+--------+-------------+--------+--------+-----------+----+----------+
| timeseries| alias|storage group|dataType|encoding|compression|tags|attributes|
+--------------------------------------------------------------------------------------------------------------------------------------+--------+-------------+--------+--------+-----------+----+----------+
|root.test.xx.xx.NULL.xx.ff8081816c21dc05016c22bdca284f65.CARD.CARD-8a5b8486656aa31001656b6d35d6768e.15.temperature|| root.test| DOUBLE| PLAIN| LZO|null| null|
+--------------------------------------------------------------------------------------------------------------------------------------+--------+-------------+--------+--------+-----------+----+----------+
Total line number = 1
You can notice that the path contains NULL
I get the following error when I delete it using the CLI
IoTDB> DELETE TIMESERIES root.test.xx.xx.NULL.xx.TRANS_ELEMENT-ff8081816c21dc05016c22bdca284f65.CARD.CARD-8a5b8486656aa31001656b6d35d6768e.15.temperature
Msg: 401: Error occurred while parsing SQL to physical plan: line 1:34 mismatched input 'NULL' expecting {CREATE, INSERT, UPDATE, DELETE, SELECT, SHOW, GRANT, INTO, SET, WHERE, FROM, TO, BY, DEVICE, CONFIGURATION, DESCRIBE, SLIMIT, LIMIT, UNLINK, OFFSET, SOFFSET, FILL, LINEAR, PREVIOUS, PREVIOUSUNTILLAST, METADATA, TIMESERIES, TIMESTAMP, PROPERTY, WITH, DATATYPE, COMPRESSOR, STORAGE, GROUP, LABEL, INT32, INT64, FLOAT, DOUBLE, BOOLEAN, TEXT, PLAIN, PLAIN_DICTIONARY, RLE, DIFF, TS_2DIFF, GORILLA, REGULAR, ADD, UPSERT, VALUES, NOW, LINK, INDEX, USING, TRACING, ON, OFF, SYSTEM, READONLY, WRITABLE, DROP, MERGE, LIST, USER, PRIVILEGES, ROLE, ALL, OF, ALTER, PASSWORD, REVOKE, LOAD, WATERMARK_EMBEDDING, UNSET, TTL, FLUSH, TASK, INFO, VERSION, REMOVE, MOVE, CHILD, PATHS, DEVICES, COUNT, NODES, LEVEL, MIN_TIME, MAX_TIME, MIN_VALUE, MAX_VALUE, AVG, FIRST_VALUE, SUM, LAST_VALUE, LAST, DISABLE, ALIGN, COMPRESSION, TIME, ATTRIBUTES, TAGS, RENAME, GLOBAL, FULL, CLEAR, CACHE, TRUE, FALSE, UNCOMPRESSED, SNAPPY, GZIP, LZ4, PARTITION, SNAPSHOT, FOR, SCHEMA, DESC, ASC, '*', OPERATOR_IN, '-', '[', INT, EXPONENT, DURATION, DATETIME, ID, DOUBLE_QUOTE_STRING_LITERAL}
IoTDB>
Desktop (please complete the following information):
- OS: MacOS
- Version 0.13.0-SNAPSHOT
How do I delete this TIMESERIES
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Backticks are not escaped with the escape character ( \ ) #363
It seems that this only works with blocks of code starting on a new line, not inline code blocks. 4
Read more >p_news. pacman 0.3.0
url() has a new method "libcurl" which handles more URL schemes and follows ... an error if a null character is included in...
Read more >R: R News - MRAN - Microsoft
A hyphen now has to be escaped in a character class to be interpreted as a literal (unless first or last in the...
Read more >Read more - MIT
More cases in which merge() could create a data frame with duplicate column ... (PR#14864) • Names containing characters which need to be...
Read more >R News - The Comprehensive R Archive Network
to create an 'Rd' section no longer gives a warning in R CMD check ... and junk display in Windows, handling special characters...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
I think the following syntax conventions should be followed in JAVA API:
executeQueryStatement
andexecuteNonQueryStatement
: The input SQL parameter needs to conform to the syntax conventions and be escaped for JAVA strings. For example, you need to add a backslash before the double-quotes. (That is: after JAVA escaping, it is consistent with the SQL statement executed on the command line.)checkTimeseriesExists
interface, since the IoTDB-SQL interface is called internally, the time-series pathname must be consistent with the SQL syntax conventions and be escaped for JAVA strings.What do you think? Welcome to discuss if you have any concerns or ideas!
@liuminghui233
This may cause some potential bugs: can we make sure all callers know the semantic?
For example, if someone implement a new Java interface like
createTimeseries
, and in the implementation, he/she callscheckTimeseriesExists
… (Don’t we callcheckTimeseriesExists
in ourcreateTimeseries
method?)Considering the above, I think adding a new function
checkTimeseriesExistsWithSQL
may be fine. @coolbeevip