Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-16619

Error using DICTIONARY value as EMBED option

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.2.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      http://10.240.32.163:8010/
      version 6.2.0-rc5

      Description

      This is trimmed-down example code, taken from something I was trying to implement. The excessive attribute assignments are there to represent all the steps the original code was trying to perform.

      IMPORT couchbase;
      
      AddressRec := {STRING key, STRING addr};
      
      addressDS := DATASET([{'cb', '1.0.1.183'}], AddressRec);
      
      addressDict := DICTIONARY(addressDS, {key => addr});
      
      CB_ADDR := addressDict['cb'].addr;
      // CB_ADDR := '1.0.1.183';
      
      UNSIGNED4 DocCount() := EMBED(couchbase : server(CB_ADDR), bucket('iot'))
          SELECT COUNT(*) AS c FROM iot;
      ENDEMBED;
      
      OUTPUT(DocCount(), NAMED('DocCount'));
      

      This code fails at runtime with the following error:

      Warning:  (0,0): error C4543: Global action appears to be context dependent - this may cause a dataset not active error (0, 0), 0, 
      

      If you flip the comments around so that CB_ADDR is instead a string literal, the code works.

      I would think that the dictionary construct should work in this context. If it should not work, or cannot be made to work, then I would request that a better error message be displayed (with line numbers) to the user.

        Attachments

          Activity

            People

            • Assignee:
              ghalliday Gavin Halliday
              Reporter:
              dcamper Dan S. Camper
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: