Skip to content

Commit

Permalink
HPCC-30285 Fix #onwarning numbers in regression queries
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Sep 26, 2023
1 parent 1c002fa commit f4464d0
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 52 deletions.
3 changes: 3 additions & 0 deletions common/thorhelper/engineerr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@

#define ENGINEERR_EXTEND_CLUSTER_WRITE ENGINE_ERROR_START
#define ENGINEERR_MIXED_COMPRESSED_WRITE ENGINE_ERROR_START+1
#define ENGINEERR_FILE_TYPE_MISMATCH ENGINE_ERROR_START+2
#define ENGINEERR_MISSING_OPTIONAL_FILE ENGINE_ERROR_START+3
#define ENGINEERR_FILE_UPTODATE ENGINE_ERROR_START+4
3 changes: 1 addition & 2 deletions ecl/hthor/hthor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8336,7 +8336,6 @@ void CHThorDiskReadBaseActivity::stop()
CHThorActivityBase::stop();
}

#define TE_FileTypeMismatch 10138 // NB: duplicated from thorlcr/shared/thexception.hpp, but be moved to common header
void CHThorDiskReadBaseActivity::checkFileType(IDistributedFile *file)
{
if (rt_csv == readType)
Expand Down Expand Up @@ -8368,7 +8367,7 @@ void CHThorDiskReadBaseActivity::checkFileType(IDistributedFile *file)
return;
if (!strieq(kind, expectedType))
{
Owned<IException> e = makeStringExceptionV(TE_FileTypeMismatch, "File format mismatch reading file: '%s'. Expected type '%s', but file is type '%s'", file->queryLogicalName(), expectedType, kind);
Owned<IException> e = makeStringExceptionV(ENGINEERR_FILE_TYPE_MISMATCH, "File format mismatch reading file: '%s'. Expected type '%s', but file is type '%s'", file->queryLogicalName(), expectedType, kind);
if (!warningOnly)
throw e.getClear();
StringBuffer tmp;
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/dfs.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//class=file

#onwarning(10140, ignore);
#onwarning(7103, ignore);

import $.setup;
Files := setup.Files(false, false, false);
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/dfsi.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//class=file

#onwarning(10140, ignore);
#onwarning(7103, ignore);

import $.setup;
Files := setup.Files(false, false, false);
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/dfsirecordof.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//class=file

#onwarning(10140, ignore);
#onwarning(7103, ignore);

import $.setup;
Files := setup.Files(false, false, false);
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/dfsj.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//class=file

#onwarning(10140, ignore);
#onwarning(7103, ignore);

import $.setup;
Files := setup.Files(false, false, false);
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/dfsrecordof.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//class=file

#onwarning(10140, ignore);
#onwarning(7103, ignore);

import $.setup;
Files := setup.Files(false, false, false);
Expand Down
6 changes: 3 additions & 3 deletions testing/regress/ecl/dynamicoptflag.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import $.setup;
prefix := setup.Files(false, false).QueryFilePrefix;

#onwarning (4522, ignore);
#onwarning (4523, ignore);
#onwarning(10140, ignore);
#onwarning(4522, ignore);
#onwarning(4523, ignore);
#onwarning(7103, ignore);

d := dataset(DYNAMIC(prefix + 'no_such_file'), {string10 f}, FLAT, OPT);
output(d);
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/keyed_join4.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#option('warnOnImplicitJoinLimit', false);

#onwarning(10140, ignore);
#onwarning(7103, ignore);

import $.setup;
prefix := setup.Files(false, false).QueryFilePrefix;
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/nestedtranslate.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//class=file
//version multiPart=true

#onwarning(10138, ignore);
#onwarning(7102, ignore);

import ^ as root;
multiPart := #IFDEFINED(root.multiPart, true);
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/optflag.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import $.setup;
prefix := setup.Files(false, false).QueryFilePrefix;
#onwarning(4523, ignore);
#onwarning(4522, ignore);
#onwarning(10140, ignore);
#onwarning(7103, ignore);

d := dataset(prefix + 'no_such_file', {string10 f}, FLAT, OPT);
output(d);
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/optflag2.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import $.setup;
import Std.File;

#onwarning(10140, ignore);
#onwarning(7103, ignore);

//version optRemoteRead=false
//version optRemoteRead=true
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/splitter-partialstart.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ prefix := setup.Files(false, false).QueryFilePrefix;

import Std;

#onwarning(10125, ignore); // ignore UPDATE 'up to date' messages, so that output is consistent across engines
#onwarning(7104, ignore); // ignore UPDATE 'up to date' messages, so that output is consistent across engines

rec := RECORD
unsigned4 id;
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/spray_test_json.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//nohthor
//nothor

#onwarning(10138, ignore);
#onwarning(7102, ignore);

//version isSmallFile=true,isUnBallanced=false
//version isSmallFile=true,isUnBallanced=true
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/update.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//noRoxie
//nolocal

#onwarning(10125, ignore); // ignore UPDATE 'up to date' messages, so that output is consistent across engines
#onwarning(7104, ignore); // ignore UPDATE 'up to date' messages, so that output is consistent across engines

import Std.File AS FileServices;
import $.setup;
Expand Down
2 changes: 1 addition & 1 deletion testing/regress/ecl/xmlread.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//class=file
//version multiPart=true

#onwarning(10138, ignore);
#onwarning(7102, ignore);

import ^ as root;
multiPart := #IFDEFINED(root.multiPart, true);
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/fetch/thfetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CFetchActivityMaster : public CMasterActivity
if (fetchFile)
{
if (isFileKey(fetchFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read index as a flat file: %s", fname.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read index as a flat file: %s", fname.get());
Owned<IFileDescriptor> fileDesc = getConfiguredFileDescriptor(*fetchFile);
void *ekey;
size32_t ekeylen;
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/hashdistrib/thhashdistrib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class IndexDistributeActivityMaster : public HashDistributeMasterBase
if (0 == file->numParts())
throw MakeActivityException(this, 0, "KeyedDistribute: Can't distribute based on an empty key: %s", scoped.str());
if (!isFileKey(file))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read flat file as an index: %s", indexFileName.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read flat file as an index: %s", indexFileName.get());

checkFormatCrc(this, file, helper->getFormatCrc(), nullptr, helper->getFormatCrc(), nullptr, true);
Owned<IFileDescriptor> fileDesc = file->getFileDescriptor();
Expand Down
4 changes: 2 additions & 2 deletions thorlcr/activities/keydiff/thkeydiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class CKeyDiffMaster : public CMasterActivity
originalIndexFile.setown(lookupReadFile(originalHelperName, AccessMode::readRandom, false, false, false));
newIndexFile.setown(lookupReadFile(updatedHelperName, AccessMode::readRandom, false, false, false));
if (!isFileKey(originalIndexFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read flat file as an index: %s", originalHelperName.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read flat file as an index: %s", originalHelperName.get());
if (!isFileKey(newIndexFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read flat file as an index: %s", updatedHelperName.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read flat file as an index: %s", updatedHelperName.get());
if (originalIndexFile->numParts() != newIndexFile->numParts())
throw MakeActivityException(this, TE_KeyDiffIndexSizeMismatch, "Index %s and %s differ in width", originalName.get(), updatedName.get());
if (originalIndexFile->querySuperFile() || newIndexFile->querySuperFile())
Expand Down
4 changes: 2 additions & 2 deletions thorlcr/activities/keyedjoin/thkeyedjoin-legacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ class CKeyedJoinMaster : public CMasterActivity
if (indexFile)
{
if (!isFileKey(indexFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read flat file as an index: %s", indexFileName.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read flat file as an index: %s", indexFileName.get());
unsigned numParts = 0;
localKey = indexFile->queryAttributes().getPropBool("@local");

if (container.queryLocalData() && !localKey)
throw MakeActivityException(this, TE_FileTypeMismatch, "Keyed Join cannot be LOCAL unless supplied index is local");
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Keyed Join cannot be LOCAL unless supplied index is local");

checkFormatCrc(this, indexFile, helper->getIndexFormatCrc(), helper->queryIndexRecordSize(), helper->getProjectedIndexFormatCrc(), helper->queryProjectedIndexRecordSize(), true);
Owned<IFileDescriptor> indexFileDesc = indexFile->getFileDescriptor();
Expand Down
4 changes: 2 additions & 2 deletions thorlcr/activities/keyedjoin/thkeyedjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class CKeyedJoinMaster : public CMasterActivity
if (indexFile)
{
if (!isFileKey(indexFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read flat file as an index: %s", indexFileName.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read flat file as an index: %s", indexFileName.get());
IDistributedSuperFile *superIndex = indexFile->querySuperFile();

unsigned numSuperIndexSubs = superIndex?superIndex->numSubFiles(true):1;
Expand All @@ -321,7 +321,7 @@ class CKeyedJoinMaster : public CMasterActivity
if (dataFile)
{
if (isFileKey(dataFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Full-Keyed-Join: Attempting to read index as a flat file (fetch file): %s", fetchFilename.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Full-Keyed-Join: Attempting to read index as a flat file (fetch file): %s", fetchFilename.get());
if (superIndex)
throw MakeActivityException(this, 0, "Full-Keyed-Join: Superkeys with full keyed joins are not supported");

Expand Down
4 changes: 2 additions & 2 deletions thorlcr/activities/keypatch/thkeypatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class CKeyPatchMaster : public CMasterActivity

originalIndexFile.setown(lookupReadFile(originalHelperName, AccessMode::readRandom, false, false, false));
if (!isFileKey(originalIndexFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read flat file as an index: %s", originalHelperName.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read flat file as an index: %s", originalHelperName.get());
patchFile.setown(lookupReadFile(patchHelperName, AccessMode::readRandom, false, false, false));
if (isFileKey(patchFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read index as a patch file: %s", patchHelperName.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read index as a patch file: %s", patchHelperName.get());

if (originalIndexFile->numParts() != patchFile->numParts())
throw MakeActivityException(this, TE_KeyPatchIndexSizeMismatch, "Index %s and patch %s differ in width", originalName.get(), patchName.get());
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/msort/thmsort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CMSortActivityMaster : public CSortBaseActivityMaster
{
Owned<IDistributedFile> coSortFile = lookupReadFile(cosortlogname, AccessMode::readSequential, false, false, false);
if (isFileKey(coSortFile))
throw MakeActivityException(this, TE_FileTypeMismatch, "Attempting to read index as a flat file: %s", cosortlogname.get());
throw MakeActivityException(this, ENGINEERR_FILE_TYPE_MISMATCH, "Attempting to read index as a flat file: %s", cosortlogname.get());
Owned<IFileDescriptor> fileDesc = coSortFile->getFileDescriptor();
unsigned o;
for (o=0; o<fileDesc->numParts(); o++)
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/graph/thgraphmaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ bool CMasterGraphElement::checkUpdate()
if ((eclCRC == (unsigned)props.getPropInt("@eclCRC")) && (totalCRC == (unsigned __int64)props.getPropInt64("@totalCRC")))
{
// so this needs pruning
Owned<IThorException> e = MakeActivityWarning(this, TE_UpToDate, "output file = '%s' - is up to date - it will not be rebuilt", file->queryLogicalName());
Owned<IThorException> e = MakeActivityWarning(this, ENGINEERR_FILE_UPTODATE, "output file = '%s' - is up to date - it will not be rebuilt", file->queryLogicalName());
queryOwner().fireException(e);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/mfilemanager/thmfilemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class CFileManager : public CSimpleInterface, implements IThorFileManager
throw MakeStringException(TE_MachineOrderNotFound, "Missing logical file %s\n", scopedName.str());
if (reportOptional)
{
Owned<IThorException> e = MakeThorException(TE_MissingOptionalFile, "Input file '%s' was missing but declared optional", scopedName.str());
Owned<IThorException> e = MakeThorException(ENGINEERR_MISSING_OPTIONAL_FILE, "Input file '%s' was missing but declared optional", scopedName.str());
e->setAction(tea_warning);
e->setSeverity(SeverityWarning);
reportExceptionToWorkunitCheckIgnore(job.queryWorkUnit(), e);
Expand Down
37 changes: 17 additions & 20 deletions thorlcr/shared/thexception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,26 +143,23 @@
#define TE_FetchOutOfRange THOR_ERROR_START + 122
#define TE_IndexMissing THOR_ERROR_START + 123
#define TE_FormatCrcMismatch THOR_ERROR_START + 124
#define TE_UpToDate THOR_ERROR_START + 125
#define TE_UnimplementedFeature THOR_ERROR_START + 126
#define TE_CompressionMismatch THOR_ERROR_START + 127
#define TE_EncryptionMismatch THOR_ERROR_START + 128
#define TE_DistributeFailedSkewExceeded THOR_ERROR_START + 129
#define TE_SeriailzationError THOR_ERROR_START + 130
#define TE_NotSorted THOR_ERROR_START + 131
#define TE_LargeAggregateTable THOR_ERROR_START + 132
#define TE_SkewWarning THOR_ERROR_START + 133
#define TE_SkewError THOR_ERROR_START + 134
#define TE_KERN THOR_ERROR_START + 135
#define TE_WorkUnitAbortingDumpInfo THOR_ERROR_START + 136
#define TE_RowLeaksDetected THOR_ERROR_START + 137
#define TE_FileTypeMismatch THOR_ERROR_START + 138
#define TE_RemoteReadFailure THOR_ERROR_START + 139
#define TE_MissingOptionalFile THOR_ERROR_START + 140
#define TE_UnsupportedSortOrder THOR_ERROR_START + 141
#define TE_CostExceeded THOR_ERROR_START + 142
#define TE_InvalidSortConnect THOR_ERROR_START + 143
#define TE_Final THOR_ERROR_START + 144 // keep this last
#define TE_UnimplementedFeature THOR_ERROR_START + 125
#define TE_CompressionMismatch THOR_ERROR_START + 126
#define TE_EncryptionMismatch THOR_ERROR_START + 127
#define TE_DistributeFailedSkewExceeded THOR_ERROR_START + 128
#define TE_SeriailzationError THOR_ERROR_START + 129
#define TE_NotSorted THOR_ERROR_START + 130
#define TE_LargeAggregateTable THOR_ERROR_START + 131
#define TE_SkewWarning THOR_ERROR_START + 132
#define TE_SkewError THOR_ERROR_START + 133
#define TE_KERN THOR_ERROR_START + 134
#define TE_WorkUnitAbortingDumpInfo THOR_ERROR_START + 135
#define TE_RowLeaksDetected THOR_ERROR_START + 136
#define TE_RemoteReadFailure THOR_ERROR_START + 137
#define TE_UnsupportedSortOrder THOR_ERROR_START + 138
#define TE_CostExceeded THOR_ERROR_START + 139
#define TE_InvalidSortConnect THOR_ERROR_START + 140
#define TE_Final THOR_ERROR_START + 141 // keep this last
#define ISTHOREXCEPTION(n) (n > THOR_ERROR_START && n < TE_Final)

#endif
2 changes: 1 addition & 1 deletion thorlcr/thorutil/thormisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ void checkFileType(CActivityBase *activity, IDistributedFile *file, const char *
return;
if (!strieq(kind, expectedType))
{
Owned<IThorException> e = MakeActivityException(activity, TE_FileTypeMismatch, "File format mismatch reading file: '%s'. Expected type '%s', but file is type '%s'", file->queryLogicalName(), expectedType, kind);
Owned<IThorException> e = MakeActivityException(activity, ENGINEERR_FILE_TYPE_MISMATCH, "File format mismatch reading file: '%s'. Expected type '%s', but file is type '%s'", file->queryLogicalName(), expectedType, kind);
if (throwException)
throw e.getClear();
e->setAction(tea_warning);
Expand Down

0 comments on commit f4464d0

Please sign in to comment.