hefeix / szl

Automatically exported from code.google.com/p/szl
Other
0 stars 0 forks source link

questions about szl #23

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
OS :  x86_64 GNU/Linux
App : szl 1.0 (http://code.google.com/p/szl/downloads/list)

Input :The input file is recordio format which is offer by szl, with 100 
records in it. Each record has channel field, bug only 92 records have 
refer_info.g_f.

Script : case_ok.szl, case_bad1.szl, base_bad2.szl

Question : the three cases are suppose to have same result , but it is not.

Case 1:
    Input sawzall script :(case_ok.szl)
    .....
      1 proto "log_wap_access.proto"
      2 
      3 pv_channel : table sum[channel:bytes] of int;
      4 
      5 log : log_wap_access = input;
      6 channel: bytes = ?{if(def(log.channel)) result log.channel; else result B"";};
      7 emit pv_channel[channel] <- 1;
    ....

    Input data :(input)
    Run command :./szl case_ok.szl input --use_recordio=true --protocol_compiler=./protoc --protocol_compiler_plugin=./protoc-gen-szl --table_output=*
    Result :   pv_channel[WAP_SWEB_ACS] = 100

Case 2:
    Input sawzall script :(case_bad1.szl)
      ....
      1 proto "log_wap_access.proto"
      2 
      3 pv_channel : table sum[channel:bytes] of int;
      4 
      5 log : log_wap_access = input;
      6 channel: bytes = ?{if(def(log.channel)) result log.channel; else result B"";};
      7 emit pv_channel[channel] <- 1;
      8 
      9 # this variable is not used
     10 usless : uint = log.refer_info.g_f;
    ....
    Input data :(input)
    Run command :./szl case_bad1.szl input --use_recordio=true --protocol_compiler=./protoc --protocol_compiler_plugin=./protoc-gen-szl --table_output=*
    Result:     pv_channel[WAP_SWEB_ACS] = 92
    pv_channel[] = 8

Case 3:
    Input sawzall script :(case_bad2.szl)
      ....
      1 proto "log_wap_access.proto"
      2 
      3 pv_channel : table sum[channel:bytes] of int;
      4 
      5 # this variable is not used
      6 usless_table : table collection of log_wap_access;
      7 
      8 log : log_wap_access = input;
      9 channel: bytes = ?{if(def(log.channel)) result log.channel; else result B"";};
      10 emit pv_channel[channel] <- 1;
    ....
    Input data :(input)
    Run command :./szl case_bad2.szl input --use_recordio=true --protocol_compiler=./protoc --protocol_compiler_plugin=./protoc-gen-szl --table_output=*
    Result:     pv_channel[WAP_SWEB_ACS] = 92
    pv_channel[] = 8

Original issue reported on code.google.com by luoxingwill@gmail.com on 2 Mar 2012 at 11:31

Attachments: