Skip to content

Commit

Permalink
Inching forward
Browse files Browse the repository at this point in the history
  • Loading branch information
dcamper committed Dec 27, 2023
1 parent 03be8ee commit 01f5cbc
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 24 deletions.
3 changes: 2 additions & 1 deletion ecl/hql/hqlattr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ unsigned getOperatorMetaFlags(node_operator op)
case no_thor:
case no_flat:
case no_pipe:
case no_filetype:
case no_joined:
case no_any:
case no_xml:
Expand Down Expand Up @@ -622,7 +623,7 @@ unsigned getOperatorMetaFlags(node_operator op)

case no_unused6:
case no_unused13: case no_unused14: case no_unused15:
case no_unused34: case no_unused35: case no_unused36: case no_unused37: case no_unused38:
case no_unused35: case no_unused36: case no_unused37: case no_unused38:
case no_unused40: case no_unused41: case no_unused42: case no_unused43: case no_unused44: case no_unused45: case no_unused46: case no_unused47: case no_unused48: case no_unused49:
case no_unused50: case no_unused52:
case no_unused80:
Expand Down
4 changes: 3 additions & 1 deletion ecl/hql/hqlexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,7 @@ const char *getOpString(node_operator op)
case no_csv: return "CSV";
case no_xml: return "XML";
case no_json: return "JSON";
case no_filetype: return "TYPE";

case no_when: return "WHEN";
case no_priority: return "PRIORITY";
Expand Down Expand Up @@ -2020,7 +2021,7 @@ const char *getOpString(node_operator op)

case no_unused6:
case no_unused13: case no_unused14: case no_unused15:
case no_unused34: case no_unused35: case no_unused36: case no_unused37: case no_unused38:
case no_unused35: case no_unused36: case no_unused37: case no_unused38:
case no_unused40: case no_unused41: case no_unused42: case no_unused43: case no_unused44: case no_unused45: case no_unused46: case no_unused47: case no_unused48: case no_unused49:
case no_unused50: case no_unused52:
case no_unused80:
Expand Down Expand Up @@ -5095,6 +5096,7 @@ unsigned CHqlRealExpression::getCachedEclCRC()
case no_csv:
case no_xml:
case no_json:
case no_filetype:
case no_null:
if (thisType && (thisType->getTypeCode() == type_null))
thisType = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion ecl/hql/hqlexpr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ enum node_operator : unsigned short {
no_unlikely,
no_inline,
no_nwaydistribute,
no_unused34,
no_filetype, // File format/type information (input or output)
no_unused35,
no_unused36,
no_unused37,
Expand Down
2 changes: 1 addition & 1 deletion ecl/hql/hqlgram2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9000,7 +9000,7 @@ void HqlGram::setPluggableModeExpr(attribute & targetAttr, attribute & mode, Hql
// you should be only trying to load a plugin
IAtom * fileFormat = lower(mode.getId());
StringBuffer fileFormatStr(fileFormat->queryStr());

// TODO: Look for a plugin filetype of name fileFormatStr
DBGLOG("HqlGram::setPluggableModeExpr processing file type %s", fileFormatStr.str());

Expand Down
2 changes: 1 addition & 1 deletion ecl/hql/hqlir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ const char * getOperatorIRText(node_operator op)
EXPAND_CASE(no,unlikely);
EXPAND_CASE(no,inline);
EXPAND_CASE(no,nwaydistribute);
EXPAND_CASE(no,unused34);
EXPAND_CASE(no,unused35);
EXPAND_CASE(no,unused36);
EXPAND_CASE(no,unused37);
Expand Down Expand Up @@ -662,6 +661,7 @@ const char * getOperatorIRText(node_operator op)
EXPAND_CASE(no,getenv);
EXPAND_CASE(no,json);
EXPAND_CASE(no,matched_injoin);
EXPAND_CASE(no,filetype);
}

return "<unknown>";
Expand Down
1 change: 1 addition & 0 deletions ecl/hql/hqltrans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2687,6 +2687,7 @@ bool onlyTransformOnce(IHqlExpression * expr)
case no_csv:
case no_xml:
case no_json:
case no_filetype:
case no_list:
return (expr->numChildren() == 0);
case no_select:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,38 @@
############################################################################## */

NamesLayout := RECORD
STRING20 surname;
STRING10 forename;
INTEGER2 age := 25;
STRING20 surname;
STRING10 forename;
INTEGER2 age := 25;
END;

//-----------------------------------------------------------
// All of the following represent referencing legacy/built-in
// file types and their options with a new syntax
//-----------------------------------------------------------
namesTableFlat_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(FLAT), __COMPRESSED__, __GROUPED__);
OUTPUT(namesTableFlat_1, ALL);
namesTableFlat_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(FLAT), __COMPRESSED__, __GROUPED__, OPT);
OUTPUT(namesTableFlat_1, {namesTableFlat_1}, '~filetypetest::namestableflat_1', OVERWRITE);

namesTableThor_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(THOR));
OUTPUT(namesTableThor_1, ALL);
namesTableThor_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(THOR), OPT);
OUTPUT(namesTableThor_1, {namesTableThor_1}, '~filetypetest::namestablethor_1', OVERWRITE);

namesTableCSV_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(CSV));
OUTPUT(namesTableCSV_1, ALL);
namesTableCSV_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(CSV), OPT);
OUTPUT(namesTableCSV_1, {namesTableCSV_1}, '~filetypetest::namestablecsv_1', TYPE(CSV), OVERWRITE);

namesTableCSV_2 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(CSV : HEADING(1), SEPARATOR([',', '==>']), QUOTE(['\'', '"', '$$']), TERMINATOR(['\r\n', '\r', '\n']), NOTRIM, UTF8, MAXLENGTH(10000)));
OUTPUT(namesTableCSV_2, ALL);
namesTableCSV_2 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(CSV : HEADING(1), SEPARATOR([',', '==>']), QUOTE(['\'', '"', '$$']), TERMINATOR(['\r\n', '\r', '\n']), NOTRIM, UTF8, MAXLENGTH(10000)), OPT);
OUTPUT(namesTableCSV_2, {namesTableCSV_2}, '~filetypetest::namestablecsv_2', TYPE(CSV : SEPARATOR('\t')), OVERWRITE);

namesTableXML_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(XML));
OUTPUT(namesTableXML_1, ALL);
namesTableXML_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(XML), OPT);
OUTPUT(namesTableXML_1, {namesTableXML_1}, '~filetypetest::namestablexml_1', TYPE(XML), OVERWRITE);

namesTableXML_2 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(XML : '/', NOROOT));
OUTPUT(namesTableXML_2, ALL);
namesTableXML_2 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(XML : '/', NOROOT), OPT);
OUTPUT(namesTableXML_2, {namesTableXML_2}, '~filetypetest::namestablexml_2', TYPE(XML : HEADING('<foo>', '</foo>')), OVERWRITE);

namesTableJSON_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(JSON));
OUTPUT(namesTableJSON_1, ALL);
namesTableJSON_1 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(JSON), OPT);
OUTPUT(namesTableJSON_1, {namesTableJSON_1}, '~filetypetest::namestablejson_1', TYPE(JSON), OVERWRITE);

namesTableJSON_2 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(JSON : '/', NOROOT));
OUTPUT(namesTableJSON_2, ALL);
namesTableJSON_2 := DATASET(DYNAMIC('x'), NamesLayout, TYPE(JSON : '/', NOROOT), OPT);
OUTPUT(namesTableJSON_2, {namesTableJSON_2}, '~filetypetest::namestablejson_2', TYPE(JSON : TRIM), OVERWRITE);

//-----------------------------------------------------------
// What follows is testing pluggable file types
Expand Down

0 comments on commit 01f5cbc

Please sign in to comment.