Fri Aug 14, 2020 11:03 am
Login Register Lost Password? Contact Us


Unable to expand constant expression when using cache

Comments and questions related to the Enterprise Control Language

Wed Jun 03, 2020 3:57 pm Change Time Zone

Hi,

Can you please help me resolve this code:
Code: Select all
IMPORT KMeans;

Fit (original_data, features)  := FUNCTIONMACRO
      
    StrRec := RECORD
        STRING value;
    END;
   
    //converts the set of features to Strings
    featuresDS := DATASET(features, StrRec);
   
    EncoderRec := RECORD
        STRING feature_name := featuresDS.value;
        SET OF STRING categories := (SET OF STRING) SET(original_data, #EXPAND(featuresDS.value);; //here I want the identifer and not the string
    END;

    result := TABLE(featuresDS, EncoderRec);
RETURN result;
ENDMACRO;

//Import raw data.
Raw_data := KMeans.Test.Datasets.DSIris.ds;
encoder := Fit(Raw_data, ['sepal_length', 'sepal_width']);
OUTPUT(encoder);


I am facing this issue frequently when using #EXPAND. Can you provide a rule of thumb to avoid this error?


Best regards,

Vannel,
vzeufack
 
Posts: 39
Joined: Tue Sep 25, 2018 3:52 pm

Wed Jun 03, 2020 6:10 pm Change Time Zone

The error is on "#EXPAND(featuresDS.value)". It says:
2071: Unable to expand constant expression when using cache. Try disabling cache.
vzeufack
 
Posts: 39
Joined: Tue Sep 25, 2018 3:52 pm

Thu Jun 04, 2020 7:03 am Change Time Zone

Which version of the system are you using? The cache was an idea to speed up ECL compilation. We eventually decided it could not be implemented without too many limitations - so it has been removed/disabled from recent versions (e.g. 7.8).

There should be options to disable it (try eclcc -help -v for a full list of options). E.g. --metacache=
ghalliday
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 196
Joined: Wed May 18, 2011 9:48 am

Thu Jun 04, 2020 9:44 pm Change Time Zone

Hi @ghalliday,

I was using version 7.0.4 which I upgraged to 7.8.8 but the problem persists.
I looked up the commands but did not find any which allows to disable cache.
--metacache: specify directory to store distributed meta information


Best regards,

Vannel,
vzeufack
 
Posts: 39
Joined: Tue Sep 25, 2018 3:52 pm

Thu Jun 04, 2020 10:17 pm Change Time Zone

I think this is related to this issue: viewtopic.php?f=8&t=650#.

I may have to find another way to implement this module.
vzeufack
 
Posts: 39
Joined: Tue Sep 25, 2018 3:52 pm

Fri Jun 05, 2020 7:04 am Change Time Zone

I think you are right, i didn't read the ecl carefully enough. The argument to #expand must be a compile time constant.
ghalliday
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 196
Joined: Wed May 18, 2011 9:48 am


Return to ECL

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron