Explorar o código

HPCC-22308 Make fieldTranslation options consistent

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith %!s(int64=6) %!d(string=hai) anos
pai
achega
6dd7132947

+ 1 - 1
ecl/eclagent/eclagent.cpp

@@ -695,7 +695,7 @@ RecordTranslationMode EclAgent::getLayoutTranslationMode() const
     if(wu->hasDebugValue("layoutTranslation"))
         wu->getDebugValue("layoutTranslation", val);
     else
-        config->getProp("@layoutTranslationEnabled", val.s);
+        config->getProp("@fieldTranslationEnabled", val.s);
     return getTranslationMode(val.str());
 }
 

+ 1 - 1
ecl/regress/fetch12.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option('targetClusterType', 'roxie');
 
 import std.system.thorlib,lib_stringlib;

+ 1 - 1
ecl/regress/hthor_setup.ecl

@@ -1,6 +1,6 @@
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option('targetClusterType', 'hthor');
 #option('testIgnoreMaxLength',true);
 prefix := 'hthor';

+ 1 - 1
ecl/regress/indexsubstr.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 import std.system.thorlib,lib_stringlib;
 prefix := 'hthor';
 useLayoutTrans := false;

+ 1 - 1
ecl/regress/issue10045.ecl

@@ -1,6 +1,6 @@
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option('targetClusterType','roxie');
 prefix := 'thor';
 useLayoutTrans := false;

+ 1 - 1
ecl/regress/normalize3.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option ('useLinkedNormalize', true);
 #option ('supportsLinkedChildRows', true);
 #option ('implicitLinkedChildRows', true);

+ 1 - 1
ecl/regress/payload2.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option ('targetClusterType', 'hthor');
 #option ('implicitLinkedChildRows', true);
 

+ 1 - 1
ecl/regress/sqaggbug.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option('targetClusterType', 'hthor');
 #option ('optimizeDiskSource',true);
 #option ('optimizeChildSource',false);

+ 1 - 1
ecl/regress/sqagghl.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option('targetClusterType', 'hthor');
 #option('testlcr', true);
 

+ 2 - 2
ecl/regress/sqaggseqr.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option('targetClusterType', 'roxie');
 #option('testlcr', false);
 
@@ -607,4 +607,4 @@ output(xpersons, { sqHousePersonBookDs.addr, surname, bestBook := xxbooksByRatin
 output(xpersons, { sqHousePersonBookDs.addr, surname, firstBook := xxbooks[1].name + ': ' + xxbooks[1].author }),
 #end
 output('done')
-);
+);

+ 2 - 2
ecl/regress/sqaggseqrl.ecl

@@ -17,7 +17,7 @@
 
 #option('foldConstantDatasets', 0);
 #option('pickBestEngine', 0);
-#option('layoutTranslationEnabled', 0);
+#option('layoutTranslation', 0);
 #option('targetClusterType', 'roxie');
 #option('testlcr', true);
 
@@ -607,4 +607,4 @@ output(xpersons, { sqHousePersonBookDs.addr, surname, bestBook := xxbooksByRatin
 output(xpersons, { sqHousePersonBookDs.addr, surname, firstBook := xxbooks[1].name + ': ' + xxbooks[1].author }),
 #end
 output('done')
-);
+);

+ 11 - 0
initfiles/componentfiles/configschema/xsd/eclagent.xsd

@@ -56,6 +56,17 @@
                     <xs:attribute name="analyzeWorkunit" hpcc:displayName="Analyze Workunit" type="xs:boolean"
                                   hpcc:presetValue="false"
                                   hpcc:tooltip="eclAgent analyzes workunit post-execution"/>
+                    <xs:attribute name="fieldTranslationEnabled" hpcc:displayName="Enable Field Translation"
+                                  hpcc:presetValue="payload"
+                                  hpcc:tooltip="Enables translation (where possible) of mismatched index layouts on-the-fly. Specify 'payload' to attempt to translate payload fields only">
+                        <xs:simpleType>
+                            <xs:restriction base="xs:string">
+                                <xs:enumeration value="false" hpcc:displayName="False" hpcc:desciption=""/>
+                                <xs:enumeration value="true" hpcc:displayName="true" hpcc:description=""/>
+                                <xs:enumeration value="payload" hpcc:displayName="Payload" hpcc:description=""/>
+                            </xs:restriction>
+                        </xs:simpleType>
+                    </xs:attribute>
                 </xs:attributeGroup>
                 <xs:sequence>
                     <xs:element name="Instance" hpcc:itemType="hwinstance" maxOccurs="unbounded"

+ 1 - 1
initfiles/componentfiles/configschema/xsd/roxie.xsd

@@ -110,7 +110,7 @@
                                   hpcc:displayName="flushJHtreeCacheOnOOM" hpcc:presetValue="true"
                                   hpcc:tooltip="Should the index node memory allocation flush the cache and retry if memory allocation fails"/>
                     <xs:attribute name="fieldTranslationEnabled" hpcc:displayName="Enable Field Translation"
-                                  hpcc:presetValue="false"
+                                  hpcc:presetValue="payload"
                                   hpcc:tooltip="Enables translation (where possible) of mismatched index layouts on-the-fly. Specify 'payload' to attempt to translate payload fields only">
                         <xs:simpleType>
                             <xs:restriction base="xs:string">

+ 11 - 1
initfiles/componentfiles/configschema/xsd/thor.xsd

@@ -223,7 +223,17 @@
                               hpcc:tooltip="HTTP Header field to use for sending and receiving CallerId"/>
                 <xs:attribute name="httpGlobalIdHeader" type="xs:string" hpcc:displayName="HTTP GlobalId Header" hpcc:presetValue="HPCC-Global-Id"
                               hpcc:tooltip="HTTP Header field to use for sending and receiving GlobalId"/>
-
+                <xs:attribute name="fieldTranslationEnabled" hpcc:displayName="Enable Field Translation"
+                              hpcc:presetValue="payload"
+                              hpcc:tooltip="Enables translation (where possible) of mismatched index layouts on-the-fly. Specify 'payload' to attempt to translate payload fields only">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                            <xs:enumeration value="false" hpcc:displayName="False" hpcc:desciption=""/>
+                            <xs:enumeration value="true" hpcc:displayName="true" hpcc:description=""/>
+                            <xs:enumeration value="payload" hpcc:displayName="Payload" hpcc:description=""/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
             </xs:complexType>
         </xs:element>
     </hpcc:insert>

+ 14 - 0
initfiles/componentfiles/configxml/thor.xsd.in

@@ -656,6 +656,20 @@
         </xs:annotation>
       </xs:attribute>
     </xs:complexType>
+    <xs:attribute name="fieldTranslationEnabled" use="optional" default="payload">
+      <xs:annotation>
+        <xs:appinfo>
+          <tooltip>Enables translation (where possible) of mismatched file layouts on-the-fly. Specify 'payload' to attempt to translate payload fields only</tooltip>
+        </xs:appinfo>
+      </xs:annotation>
+      <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:enumeration value="false"/>
+          <xs:enumeration value="true"/>
+          <xs:enumeration value="payload"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
     <xs:key name="thorProcessKey1">
       <xs:selector xpath="./ThorMasterProcess|./ThorSlaveProcess"/>
       <xs:field xpath="@name"/>

+ 1 - 1
testing/ecl/Regress/Prepare.pm

@@ -278,7 +278,7 @@ sub _copy_query($$$;$)
     open(OUT, '>', $destpath) or $self->{engine}->error("Could not write $destpath: $!");
     print(OUT "#option('$_', $self->{ecloptions}->{$_});\n") foreach(sort(keys(%{$self->{ecloptions}})));
     my $needsRLT = ($variant && $variant->{needsRLT} ? 1 : 0);
-    print(OUT "#option('layoutTranslationEnabled', $needsRLT);\n");
+    print(OUT "#option('fieldTranslationEnabled', $needsRLT);\n");
     Regress::Query::print_variant_ecl($variant, \*OUT) if($variant);
     my $setupFileLocation = "$self->{setup_file_location}";
     print(OUT "setupTextFileLocation := '$setupFileLocation';\n");

+ 2 - 0
thorlcr/thorutil/thormisc.cpp

@@ -1429,6 +1429,8 @@ RecordTranslationMode getTranslationMode(CActivityBase &activity)
 {
     StringBuffer val;
     activity.getOpt("layoutTranslation", val);
+    if (!val.length())
+        globals->getProp("@fieldTranslationEnabled", val);
     return getTranslationMode(val);
 }