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

Weird NORMALIZE behaviour with LOCAL and Inline Dataset

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 7.6.58
    • 8.4.0
    • Code Generator
    • None
    • LnP Dev

    Description

      Not sure this is that big of an issue overall, but weird enough that I felt compelled to report it.  The use of LOCAL on NORMALIZE is allowed, but logically does not seem to have a lot of value in this case.  That said, the _myNames named output is coming out with 25 rows on a 25-way thor, as if the system copied it to every server on system.  Similar behavior is seen on other sized systems (i.e. 10 rows come out on a 10-way).

       Standalone code:

      Layouts := module  export _namesLayout	:= {
          string _id, 
          unicode familyname, 
          dataset({unicode firstname}) firstnames, 
          dataset({unicode middlename}) middlenames,
          dataset({unicode suffix}) suffixes,
          dataset({unicode firstname}) partnerfirstnames,
          unsigned8 hashkey_familyname 		:= 0,
          unsigned8 hashkey_firstname  		:= 0,
          unsigned8 hashkey_middlename  	:= 0,
          unsigned8 hashkey_suffix  			:= 0,
          unsigned8 hashkey_partnername  	:= 0,
          dataset({unsigned8 _hashkey}) hashkey_hasFirstNames := dataset([],{unsigned8 _hashkey}),
          dataset({unsigned8 _hashkey}) hashkey_hasMiddleNames := dataset([],{unsigned8 _hashkey}),
          dataset({unsigned8 _hashkey}) hashkey_missedMiddleNames := dataset([],{unsigned8 _hashkey})
        };  
      
      export _expandedNamesLayout	:= {
          _namesLayout,
          unicode firstname, 
          unicode middlename, 
          unicode suffix, 
          unicode partnername
        };end;
      __names					:= distribute(dataset(
        [
          {.....}],{unicode firstname}), dataset([{'C'}],{unicode middlename}), dataset([],{unicode suffix}), dataset([],{unicode firstname})}
        ],Layouts._namesLayout
      ),hash32(_id));{unsigned it, unsigned fncnt, Layouts._expandedNamesLayout}
          
      
      getFirstNames(recordof(Layouts._namesLayout) l, integer _cnt) := transform
        self.firstname          := unicodelib.unicodetouppercase(l.firstnames[_cnt].firstname),
        self.familyname         := unicodelib.unicodetouppercase(l.familyname),
        self.hashkey_familyname := hash64(self.familyname),
        self.hashkey_firstname  := hash64(self.firstname),
        self.it                 := _cnt,
        self.fncnt              := count(l.firstnames),
        self                    := l,
        self                    := []
      end;
      
      __namesRead := dataset('~joe::temp::normtest',recordof(__names),thor);
      
      _myNames	 := normalize(__names,
                                    max(count(left.firstnames),1),
                                    getFirstNames(left,counter),local);
      
      _myNamesG	 := normalize(__names,
                                    max(count(left.firstnames),1),
                                    getFirstNames(left,counter));
      
      _myNamesR	 := normalize(__names,
                                    max(count(left.firstnames),1),
                                    getFirstNames(left,counter),local);
      
      _myNamesGR := normalize(__names,
                              max(count(left.firstnames),1),
                              getFirstNames(left,counter));
      
      sequential(
        output(__names,,'~joe::temp::normtest',overwrite,named('__names')),
        output(_myNames,named('_myNames')),
        output(_myNamesG,named('_myNamesG')),
        output(_myNamesR,named('_myNamesR')),
        output(_myNamesGR,named('_myNamesGR'))
      );
      

       

      Let me know if you have questions or need explicit workunits or archives.

       

      Attachments

        Activity

          People

            ghalliday Gavin Halliday
            joecella Joe Cella
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: