The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Auto-substitute * in SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Stefan_Wak

Austria
15 Posts

Posted - 06/23/2020 :  06:26:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello!
When trying the following SQL-Querry, /* xxx */ is replaced by a newline (\n).
I am trying to collect data of multiple files via DRILL.

SELECT `p`.`dir0` FROM `dfs.data`.`./smardFT/v1/*/parameters.parquet` as p INNER JOIN `dfs.data`.`./smardFT/v1/*/parameters.parquet` as q ON `p`.`dir0`=`q`.`dir0` WHERE ((`p`.`step` LIKE 'ETCurve_%' AND `p`.`name` = 't__PAMIb' AND `p`.`data` = 1000) AND (`q`.`name` = 't__PAMIe' AND `q`.`data` = -340)) GROUP BY `p`.`dir0`

Resulting to this:
SELECT * FROM (SELECT `p`.`dir0` FROM `dfs.data`.`./smardFT/v1
parameters.parquet` as q ON `p`.`dir0`=`q`.`dir0` WHERE ((`p`.`step` LIKE 'ETCurve_%' AND `p`.`name` = 't__PAMIb' AND `p`.`data` = 1000) AND (`q`.`name` = 't__PAMIe' AND `q`.`data` = -340)) GROUP BY `p`.`dir0`) WHERE ROWNUM <= 50

Executing the same Querry with Drill Explorer return the data.


Origin Ver. and Service Release (Select Help-->About Origin): 2020b, 9.7.5.184
Operating System: Win 10

Chris D

428 Posts

Posted - 06/23/2020 :  09:00:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

How do you know the query gets re-written? That is, where do you find out that is the case?

Origin itself will not rewrite the query like that but perhaps the Drill ODBC driver does.

It would be fairly impossible for us to duplicate your system to test and give you a definite answer.


Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

Stefan_Wak

Austria
15 Posts

Posted - 06/23/2020 :  11:06:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I got the resulting SQL-query from the "Web-Interface" from our DRILL-Server. The Server has a list of the last 100 queries with state an duration, ...

"Drill Explorer" is using the same ODBC driver.

And the Origin SQL-Editor also show this message, if i click the preview button:
Microsoft OLE DB Provider for ODBC Drivers: [MapR][Drill] (1040) Drill failed to execute the query: SELECT * FROM (SELECT `p`.`dir0` FROM
`dfs.data`.`./smardFT/v1
parameters.parquet` as q ON `p`.`dir0`=`q`.`dir0` WHERE ((`p`.`step` LIKE 'ETCurve_%' AND `p`.`name` = 't__PAMIb' AND `p`.`data` = 1000) AND (`q`.`name` = 't__PAMIe' AND `q`.`data` = -340)) GROUP BY `p`.`dir0`) WHERE ROWNUM <= 50
[30038]Query execution error. Details:[
PARSE ERROR: Lexical error at line 2, column 25. Encountered: "\n" (10), after : "`./smardFT/v1"


In the Origin SQL-Editor the following part of the query is formatet green, like a comment in C
/*/parameters.parquet` as p INNER JOIN `dfs.data`.`./smardFT/v1/*/



When trying the following:
select * from file/*/does_not/*/exist

In Origin i got this error (missing /*/does_not/*/ -> replaced with a newline):
Microsoft OLE DB Provider for ODBC Drivers: [MapR][Drill] (1040) Drill failed to execute the query: select * from file
exist

With Drill-Explorer is got the following error (with the complete query):
[MapR][Drill] (1040) Drill failed to execute the query: select * from file/*/does_not/*/exist
[30038]Query execution error. Details:[
VALIDATION ERROR: From line 1, column 15 to line 1, column 18: Object 'file' not found
Go to Top of Page

Chris D

428 Posts

Posted - 06/23/2020 :  12:33:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Well I owe you an apology. It does appear that Origin somehow does convert content between /* and */ (inclusive) into newline. I don't know why it would.

What happens when you try to use backslash for path separators?

Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

Stefan_Wak

Austria
15 Posts

Posted - 06/25/2020 :  04:47:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, i will try the backslash on tuesday, when i am back in office.

Thanks
Stefan
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000