mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Don't try to compute aggregates on virtual fields - that is, try-catch around the lookup of such fields
This commit is contained in:
@ -136,8 +136,8 @@ public class GenerateReportAction extends AbstractQActionFunction<ReportInput, R
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public ReportOutput execute(ReportInput reportInput) throws QException
|
public ReportOutput execute(ReportInput reportInput) throws QException
|
||||||
{
|
{
|
||||||
ReportOutput reportOutput = new ReportOutput();
|
ReportOutput reportOutput = new ReportOutput();
|
||||||
QReportMetaData report = getReportMetaData(reportInput);
|
QReportMetaData report = getReportMetaData(reportInput);
|
||||||
|
|
||||||
this.views = report.getViews();
|
this.views = report.getViews();
|
||||||
this.dataSources = report.getDataSources();
|
this.dataSources = report.getDataSources();
|
||||||
@ -398,7 +398,7 @@ public class GenerateReportAction extends AbstractQActionFunction<ReportInput, R
|
|||||||
RunBackendStepInput finalTransformStepInput = transformStepInput;
|
RunBackendStepInput finalTransformStepInput = transformStepInput;
|
||||||
RunBackendStepOutput finalTransformStepOutput = transformStepOutput;
|
RunBackendStepOutput finalTransformStepOutput = transformStepOutput;
|
||||||
|
|
||||||
String tableLabel = ObjectUtils.tryElse(() -> QContext.getQInstance().getTable(dataSource.getSourceTable()).getLabel(), Objects.requireNonNullElse(dataSource.getSourceTable(), ""));
|
String tableLabel = ObjectUtils.tryElse(() -> QContext.getQInstance().getTable(dataSource.getSourceTable()).getLabel(), Objects.requireNonNullElse(dataSource.getSourceTable(), ""));
|
||||||
AtomicInteger consumedCount = new AtomicInteger(0);
|
AtomicInteger consumedCount = new AtomicInteger(0);
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
@ -704,8 +704,24 @@ public class GenerateReportAction extends AbstractQActionFunction<ReportInput, R
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
for(String fieldName : record.getValues().keySet())
|
for(String fieldName : record.getValues().keySet())
|
||||||
{
|
{
|
||||||
FieldAndJoinTable fieldAndJoinTable = getFieldAndJoinTable(table, fieldName);
|
QFieldMetaData field = null;
|
||||||
QFieldMetaData field = fieldAndJoinTable.field();
|
try
|
||||||
|
{
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
// todo - memoize this, if we ever need to optimize //
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
FieldAndJoinTable fieldAndJoinTable = getFieldAndJoinTable(table, fieldName);
|
||||||
|
field = fieldAndJoinTable.field();
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// for non-real-fields... let's skip for now - but maybe treat as string in future? //
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
LOG.debug("Couldn't find field in table qInstance - won't compute aggregates for it", logPair("fieldName", fieldName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(StringUtils.hasContent(field.getPossibleValueSourceName()))
|
if(StringUtils.hasContent(field.getPossibleValueSourceName()))
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
Reference in New Issue
Block a user