Skip to content

Commit

Permalink
HPCC-30969 Add missing JSON file type support and checks
Browse files Browse the repository at this point in the history
Core library functionality.
  • Loading branch information
dcamper committed Apr 30, 2024
1 parent 54f70aa commit 646338d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ecl/hql/hqlerrors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@
#define ERR_FAIL_UPDATE_REPO 2407
#define ERR_CANNOT_RESOLVE_BRANCH 2408
#define ERR_UNKNOWN_EXCEPTION 2409
#define ERR_INVALID_JSON_RECORD 2410

#define ERR_CPP_COMPILE_ERROR 2999

Expand Down
8 changes: 8 additions & 0 deletions ecl/hql/hqlgram2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7282,6 +7282,9 @@ IHqlExpression * HqlGram::createBuildFileFromTable(IHqlExpression * table, const
case no_xml:
args.append(*createAttribute(xmlAtom, LINK(mode->queryChild(0))));
break;
case no_json:
args.append(*createAttribute(jsonAtom, LINK(mode->queryChild(0))));
break;
}

ForEachItemIn(i, buildOptions)
Expand Down Expand Up @@ -8552,6 +8555,7 @@ void HqlGram::checkJoinFlags(const attribute &err, IHqlExpression * join)
{
case no_csv:
case no_xml:
case no_json:
reportError(ERR_KEYEDNOTMATCHDATASET,err,"RIGHT side of a full keyed join must be a THOR disk file (CSV/XML) not currently supported");
break;
}
Expand Down Expand Up @@ -9030,6 +9034,10 @@ void HqlGram::checkValidRecordMode(IHqlExpression * dataset, attribute & atr, at
if (!isValidXmlRecord(dataset->queryRecord()))
reportError(ERR_INVALID_XML_RECORD, atr, "XML cannot be used on this record structure");
break;
case no_json:
if (!isValidXmlRecord(dataset->queryRecord()))
reportError(ERR_INVALID_JSON_RECORD, atr, "JSON cannot be used on this record structure");
break;
}
}

Expand Down
1 change: 1 addition & 0 deletions ecl/hqlcpp/hqliproj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,7 @@ void ImplicitProjectTransformer::gatherFieldsUsed(IHqlExpression * expr, Implici
{
case no_csv:
case no_xml:
case no_json:
break;
default:
{
Expand Down

0 comments on commit 646338d

Please sign in to comment.