You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Christian (Jira)" <ji...@apache.org> on 2021/04/07 21:59:00 UTC
[jira] [Updated] (DRILL-7892) Parameter not working
[ https://issues.apache.org/jira/browse/DRILL-7892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian updated DRILL-7892:
-----------------------------
Description:
Hi,
I'm accessing Drill (Docker version) through the MapR/Odbc driver (from within C# with Dapper). All works great but supplying parameters does not. I'm copied the code below but maybe this is a broader question as to whether parameters are supported at all - I was not able to find any documentation regarding that.
var tmpIndex = (await connection.QueryAsync<DataPoint>(@" var tmpIndex = (await connection.QueryAsync<DataPoint>(@" SELECT dir0 AS parquetindex, dealkey, rundate AS `date`, value FROM dfs.`/mnt/linuxshare/blazortest/20210331/mergepervariable` WHERE value IS NOT NULL AND dir0=@id LIMIT 1 ", new \{ id = 1 })).ToList();
The error I'm getting is this (the query succeeds without the "@id" section):
[30038]Query execution error. Details:[ PARSE ERROR: Lexical error at line 4, column 37. Encountered: "@" (64), after : ""
SQL Query: SELECT dir0 AS parquetindex, dealkey, rundate AS `date`, value FROM dfs.`/mnt/linuxshare/blazortest/20210331/mergepervariable` WHERE value IS NOT NULL AND dir0=@id ^ LIMIT 1
I tried multiple ways of specifying the parameter (e.g. placeholder through ?) - the error message changes but it never succeeds.
Any insight whether this is even doable would be appreciated.
was:
Hi,
I'm accessing Drill (Docker version) through the MapR/Odbc driver (from within C# with Dapper). All works great but supplying parameters does not. I'm copied the code below but maybe this is a broader question as to whether parameters are supported at all - I was not able to find any documentation regarding that.
var tmpIndex = (await connection.QueryAsync<DataPoint>(@" var tmpIndex = (await connection.QueryAsync<DataPoint>(@" SELECT dir0 AS parquetindex, dealkey, rundate AS `date`, value FROM dfs.`/mnt/linuxshare/blazortest/20210331/mergepervariable` WHERE value IS NOT NULL AND dir0=@id LIMIT 1 ", new \{ id = 1 })).ToList();
The error I'm getting is this:
[30038]Query execution error. Details:[ PARSE ERROR: Lexical error at line 4, column 37. Encountered: "@" (64), after : ""
SQL Query: SELECT dir0 AS parquetindex, dealkey, rundate AS `date`, value FROM dfs.`/mnt/linuxshare/blazortest/20210331/mergepervariable` WHERE value IS NOT NULL AND dir0=@id ^ LIMIT 1
I tried multiple ways of specifying the parameter (e.g. placeholder through ?) - the error message changes but it never succeeds.
Any insight whether this is even doable would be appreciated.
> Parameter not working
> ---------------------
>
> Key: DRILL-7892
> URL: https://issues.apache.org/jira/browse/DRILL-7892
> Project: Apache Drill
> Issue Type: Test
> Components: Client - ODBC
> Affects Versions: 1.18.0
> Reporter: Christian
> Priority: Major
>
> Hi,
> I'm accessing Drill (Docker version) through the MapR/Odbc driver (from within C# with Dapper). All works great but supplying parameters does not. I'm copied the code below but maybe this is a broader question as to whether parameters are supported at all - I was not able to find any documentation regarding that.
> var tmpIndex = (await connection.QueryAsync<DataPoint>(@" var tmpIndex = (await connection.QueryAsync<DataPoint>(@" SELECT dir0 AS parquetindex, dealkey, rundate AS `date`, value FROM dfs.`/mnt/linuxshare/blazortest/20210331/mergepervariable` WHERE value IS NOT NULL AND dir0=@id LIMIT 1 ", new \{ id = 1 })).ToList();
> The error I'm getting is this (the query succeeds without the "@id" section):
> [30038]Query execution error. Details:[ PARSE ERROR: Lexical error at line 4, column 37. Encountered: "@" (64), after : ""
> SQL Query: SELECT dir0 AS parquetindex, dealkey, rundate AS `date`, value FROM dfs.`/mnt/linuxshare/blazortest/20210331/mergepervariable` WHERE value IS NOT NULL AND dir0=@id ^ LIMIT 1
>
> I tried multiple ways of specifying the parameter (e.g. placeholder through ?) - the error message changes but it never succeeds.
>
> Any insight whether this is even doable would be appreciated.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)