0
我查詢一個嵌套的JSON文件,結構看起來類似如下阿帕奇鑽:保留字「用戶」作爲JSON數據文件中的列名的一個
{"user_id":1234,
"text":"example text"
"first_nested":{
"field1":"dummy string 1",
"field2":"dummy string 2"
},
"user":{
"field3":"dummy string 3",
"field4":"dummy string 4"
},
"last":1}
我有一個名爲嵌套JSON結構「用戶」,當查詢以下內容:
SELECT tbl.user AS us FROM dfs.`/filepath/trial.json` as tbl WHERE user_id=221
或
SELECT tbl.user.field1 AS us FROM dfs.`/filepath/trial.json` as tbl WHERE tbl.user_id=221
我得到以下錯誤:
UserRemoteException: PARSE ERROR: Encountered ". user" at line 1, column 11. Was expecting one of: "FROM" ... "," ... "AS" ... ... ... ... ... ... "." ... "NOT" ... "IN" ... "BETWEEN" ... "LIKE" ... "SIMILAR" ... "=" ... ">" ... "<" ... "<=" ... ">=" ... "<>" ... "+" ... "-" ... "*" ... "/" ... "||" ... "AND" ... "OR" ... "IS" ..
當我簡單地使用user
與tbl解除引用。 ,查詢將返回擁有當前鑽取簡檔的用戶的名稱。
我不能從這個json文件中更改列的名稱,我該如何解決這個問題?
*當我簡單地使用 「用戶」 不與TBL提領。 – user3516188