ECLTable: Creates an ECL "TABLE" definition.

Description Examples

Description

Creates an ECL "TABLE" definition. The TABLE function is similar to OUTPUT, but instead of writing records to a file, it outputs those records in a new table (a new dataset in the supercomputer), in memory. The new table is temporary and exists only while the specific query that invoked it is running.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  ## Not run: 
      ecl1 <- ECL$new(hostName="127.0.0.1")
      recPerson <- ECLRecord$new(name="rec_person")
      recPerson$addField("STRING", "code")
      recPerson$addField("STRING", "firstName")
      recPerson$addField("STRING", "lastName")
      recPerson$addField("STRING", "address")
      recPerson$addField("STRING", "stateCode")
      recPerson$addField("STRING", "city")
      recPerson$addField("STRING", "zip")
      ecl1$add(recPerson)
      
      dsPerson <- ECLDataset$new(name="ds_person", datasetType = recPerson, 
                  logicalFileName ="~ds::person", fileType="CSV")
      ecl1$add(dsPerson)
      
      recPersonTable <- ECLRecord$new(name="personNewTableFormat")
      recPersonTable$addField(dsPerson$getName(), "code", seperator=".")
      recPersonTable$addField(dsPerson$getName(), "firstName", seperator=".")
      recPersonTable$addField(dsPerson$getName(), "lastName", seperator=".")
      
      ecl1$add(recPersonTable)
      
      tblPerson <- ECLTable$new(name="PersonNewTable", inDataset = dsPerson, 
                      format= recPersonTable)
      ecl1$add(tblPerson)
   
## End(Not run)

rHpcc documentation built on May 2, 2019, 11:04 a.m.

Related to ECLTable in rHpcc...