cancel
Showing results for 
Search instead for 
Did you mean: 

Error at deploy clause GROUP BY in CAP

acmebcn
Participant
0 Kudos

Hi,

Yesterday I was asking how to generate a count + group by here. My question was perfectly answered.

Unfortunately, when I deployed to CF, the DB service did not start. After reviewing the log, i found the following message.

Error: com.sap.hana.di.cds: Path is missing in GROUP BY clause [1310257]

Just mention that my group by clause is filled with a non key field. The strange thing is it works in sqlite.

Best regards,

David R.

OlenaT
Advisor
Advisor
0 Kudos

Hi David,

does your entity definition looks like this

service KpiService {
    entity kpibyStatus as select from foobar {status, count(status) as count} group by status;            
}

or do you also have an entity key in the select?

 service KpiService {
    entity kpibyStatus as select from foobar {key, status, count(status) as count} group by status;            
}

Could you please also set an env variable DEBUG=true and send me the SQL generated for CREATE VIEW kpibyStatus?

Best regards,

Olena

acmebcn
Participant

Hi Olena,

We finally found it, it was a silly detail... we forgot to indicate the key field in the selection. The final entity definition it's like this:

service KpiService {
    entity kpibyStatus as select from foobar { key status, count(status) as count} group by status;            
}

Thanks a lot for your help,

David R.

Accepted Solutions (0)

Answers (1)

Answers (1)

WouterLemaire
Active Contributor
0 Kudos

We had similar problems... this is caused by the differences between sql and hana. The libraries are not exactly the same and some syntax might not always work for both.

I do not have a solution for your specific question but we managed to find a solution by directly testing with hana from our local dev environment. This blog can help you to set this up: https://blogs.sap.com/2020/03/31/hana-cli-xsa-mta-project-in-vs-code/

acmebcn
Participant
0 Kudos

Thanks Wouter. It will help a lot.

David R.