2017-05-17 58 views

回答

1

使用時,必須指定所有列的內置提取,但它很容易只是只挑需要的列(也稱爲projection)使用行集變量,如下所示:

// Do the initial extract for all columns 
@input = 
    EXTRACT colA string, 
      colB string, 
      colC string, 
      colD string, 
      colE string, 
      colF string, 
      colG string, 
      colH string, 
      colI string, 
      colJ string 

    FROM "/input/input57.csv" 
    USING Extractors.Csv(); 


// Pick (project) the columns you need 
@output = 
    SELECT colA, 
      colB, 
      colC, 
      colD, 
      colE 
    FROM @input; 


// Output the columns you need 
OUTPUT @output 
TO "/output/output.csv" 
USING Outputters.Csv(); 
相關問題