SQL Query error in Postgres missing groupBy column

Description

2017-09-13 09:54:42 ERROR http-nio-8420-exec-8:SqlExceptionHelper:131 - ERROR: column "jpanififee0_.collection_interval_sec" must appear in the GROUP BY clause or be used in an aggregate function
Position: 532
2017-09-13 09:54:42 ERROR http-nio-8420-exec-8:ThrowableMapper:43 - toResponse() caught throwable
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
at com.querydsl.jpa.impl.AbstractJPAQuery.getResultList(AbstractJPAQuery.java:160)
at com.querydsl.jpa.impl.AbstractJPAQuery.fetch(AbstractJPAQuery.java:202)
at com.thinkbiganalytics.metadata.jpa.jobrepo.nifi.NifiFeedProcessorStatisticsProvider.findForFeedStatisticsGroupedByTime(NifiFeedProcessorStatisticsProvider.java:231)
at com.thinkbiganalytics.jobrepo.rest.controller.NifiFeedProcessorStatisticsRestControllerV2.lambda$findFeedStats$6(NifiFeedProcessorStatisticsRestControllerV2.java:168)
at com.thinkbiganalytics.metadata.persistence.AggregateMetadataAccess.lambda$null$3(AggregateMetadataAccess.java:124)
at com.thinkbiganalytics.metadata.config.OperationalMetadataTransactionTemplateMetadataAccess$2.doInTransaction(OperationalMetadataTransactionTemplateMetadataAccess.java:187)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at com.thinkbiganalytics.metadata.config.OperationalMetadataTransactionTemplateMetadataAccess.read(OperationalMetadataTransactionTemplateMetadataAccess.java:144)
at com.thinkbiganalytics.metadata.config.OperationalMetadataTransactionTemplateMetadataAccess.read(OperationalMetadataTransactionTemplateMetadataAccess.java:118)
at com.thinkbiganalytics.metadata.persistence.AggregateMetadataAccess.lambda$wrap$5(AggregateMetadataAccess.java:124)
at com.thinkbiganalytics.metadata.modeshape.JcrMetadataAccess.execute(JcrMetadataAccess.java:378)
at com.thinkbiganalytics.metadata.modeshape.JcrMetadataAccess.read(JcrMetadataAccess.java:329)
at com.thinkbiganalytics.metadata.modeshape.JcrMetadataAccess.read(JcrMetadataAccess.java:297)
at com.thinkbiganalytics.metadata.persistence.AggregateMetadataAccess.read(AggregateMetadataAccess.java:86)
at com.thinkbiganalytics.jobrepo.rest.controller.NifiFeedProcessorStatisticsRestControllerV2.findFeedStats(NifiFeedProcessorStatisticsRestControllerV2.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Environment

None

Assignee

Scott Reisdorf

Reporter

Scott Reisdorf

Labels

None

Reviewer

None

Story point estimate

None

Sprint

None

Fix versions

Affects versions

Priority

Medium
Configure