You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by JP <jo...@gmail.com> on 2021/05/26 03:23:52 UTC

Failed to parse query. Column "...._KEY" not found;SQL statement:

Hi,
I am with Apache Ignite V2.9.1.And using .net thin client to perform query
on cache.
And using cache query as SqlQuery.

here is the query statement:

SELECT * FROM
"F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON".CommonConstruction
As t1  INNER JOIN 
"F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_CONSTRUCTIONPROJECTROLE".ProjectsRole
AS t2 ON t1.UUID = t2.ProjectId where t2.PersonId =
'a91f8995-2c28-4f33-9587-817749526a55' AND t2.ProjectAccessStatus = 'true'
and t2.IsDeleted != 'true' and t1.IsDeleted != 'true' AND
t1.TableName='common_project';

Exception:
Failed to parse query. Column
"F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON.COMMONCONSTRUCTION._KEY"
not found; SQL statement:
SELECT
"F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON"."COMMONCONSTRUCTION"._KEY,
"F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON"."COMMONCONSTRUCTION"._VAL
FROM CommonConstruction As t1 INNER JOIN
"F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_CONSTRUCTIONPROJECTROLE".ProjectsRole
AS t2 ON t1.UUID = t2.ProjectId where t2.PersonId =
'a91f8995-2c28-4f33-9587-817749526a55' AND t2.ProjectAccessStatus = 'true'
and t2.IsDeleted != 'true' and t1.IsDeleted != 'true' AND
t1.TableName='common_project' [42122-197]

is this issue exists or i commiting mistake somewhere? Can you please give
me suggestion.

Thanks.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Failed to parse query. Column "...._KEY" not found;SQL statement:

Posted by Pavel Tupitsyn <pt...@apache.org>.
"_key" and "_val" are predefined column names returning full key and value
objects:

    select _key, _val from CommonConstruction

On Wed, May 26, 2021 at 12:52 PM JP <jo...@gmail.com> wrote:

> Hi,
> Thanks for reply.Appriciated.
> Please use SqlFieldsQuery and list specific columns.
> Actually i m getting values corresponding to the query column.
>
> how to get key value pair as result instead of getting list of value using
> SqlFieldsQuery .Any sample query reference if possible.
>
> Thanks in advance.
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Failed to parse query. Column "...._KEY" not found;SQL statement:

Posted by JP <jo...@gmail.com>.
Hi,
Thanks for reply.Appriciated.
Please use SqlFieldsQuery and list specific columns.
Actually i m getting values corresponding to the query column.

how to get key value pair as result instead of getting list of value using
SqlFieldsQuery .Any sample query reference if possible.

Thanks in advance.





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Failed to parse query. Column "...._KEY" not found;SQL statement:

Posted by Pavel Tupitsyn <pt...@apache.org>.
Now I see the problem - you use SqlQuery, which is deprecated (obsolete)
and has some limitations.
Please use SqlFieldsQuery and list specific columns.

Alternatively, use Ignite LINQ provider [1] to perform strongly-typed SQL
queries, for example:

CommonConstruction.AsCacheQueryable()
    .Join(ProjectsRole.AsCacheQueryable(), cc => cc.Uuid, pr => pr.PersonId)
...

[1] https://www.nuget.org/packages/Apache.Ignite.Linq


On Wed, May 26, 2021 at 12:19 PM JP <jo...@gmail.com> wrote:

> 1. What if you do "select * from CommonConstruction" - does it work?
>
>     yes it is working with sqlquery.
>
> 2. Can you try listing specific columns instead of "*"?
>     if i am using specific column then i have to go with sqlfieldsquery
> instead of using sqlquery.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Failed to parse query. Column "...._KEY" not found;SQL statement:

Posted by JP <jo...@gmail.com>.
1. What if you do "select * from CommonConstruction" - does it work?

    yes it is working with sqlquery.

2. Can you try listing specific columns instead of "*"?
    if i am using specific column then i have to go with sqlfieldsquery
instead of using sqlquery.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Failed to parse query. Column "...._KEY" not found;SQL statement:

Posted by Pavel Tupitsyn <pt...@apache.org>.
1. What if you do "select * from CommonConstruction" - does it work?
2. Can you try listing specific columns instead of "*"?

On Wed, May 26, 2021 at 6:24 AM JP <jo...@gmail.com> wrote:

> Hi,
> I am with Apache Ignite V2.9.1.And using .net thin client to perform query
> on cache.
> And using cache query as SqlQuery.
>
> here is the query statement:
>
> SELECT * FROM
>
> "F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON".CommonConstruction
> As t1  INNER JOIN
>
> "F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_CONSTRUCTIONPROJECTROLE".ProjectsRole
> AS t2 ON t1.UUID = t2.ProjectId where t2.PersonId =
> 'a91f8995-2c28-4f33-9587-817749526a55' AND t2.ProjectAccessStatus = 'true'
> and t2.IsDeleted != 'true' and t1.IsDeleted != 'true' AND
> t1.TableName='common_project';
>
> Exception:
> Failed to parse query. Column
>
> "F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON.COMMONCONSTRUCTION._KEY"
> not found; SQL statement:
> SELECT
>
> "F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON"."COMMONCONSTRUCTION"._KEY,
>
> "F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_COMMON"."COMMONCONSTRUCTION"._VAL
> FROM CommonConstruction As t1 INNER JOIN
>
> "F2DEDF6E-393E-42BC-9BB3-E835A1063B30_6EFB69B0-269F-4F92-98CF-24BC0D34BA98_CONSTRUCTIONPROJECTROLE".ProjectsRole
> AS t2 ON t1.UUID = t2.ProjectId where t2.PersonId =
> 'a91f8995-2c28-4f33-9587-817749526a55' AND t2.ProjectAccessStatus = 'true'
> and t2.IsDeleted != 'true' and t1.IsDeleted != 'true' AND
> t1.TableName='common_project' [42122-197]
>
> is this issue exists or i commiting mistake somewhere? Can you please give
> me suggestion.
>
> Thanks.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>