Also note that identifiers must be quoted with `backticks` in Drill SQL.

On 2022/05/26 11:24, luoc wrote:
Hi Chris,

It is strongly recommended not to create table names beginning with numbers in 
mongo. Although mongo supports this, it can become very complex in ANSI SQL.

On May 26, 2022, at 17:16, spamo...@freenet.de wrote:

Hello,

I've got a few Mongo collections and would like to use:
01_test

apache drill (mongo.crm_test)> SHOW DATABASES;
+--------------------+
|    SCHEMA_NAME     |
+--------------------+
| mongo.01_test   |
| mongo.test     |

apache drill (mongo.crm_test)> usemongo.test;
+------+--------------------------------------------+
|  ok  |                  summary  |
+------+--------------------------------------------+
| true| Default schema changed to [mongo.test]|
+------+--------------------------------------------+

But:

apache drill (mongo.test)> usemongo.01_test;
Error: PARSE ERROR: Encountered ".01" at line 1, column 10.

SQL Query: use mongo.01_test
                    ^

[Error Id: 056ff092-822b-4113-bf06-27e960cfe69a ] (state=,code=0)


I've tried it with " and ' but nothing seems to be working for
a collection, starting with a number.
How to do this?

Thanks and kind regards,
Chris

Reply via email to