ECLTable-class: Class '"ECLTable"'

Description Extends Fields Methods 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.

Extends

Class "ECLDataset", directly.

Fields

name:

Object of class character Class name.

datasetType:

Object of class ECLRecord Input record name.

logicalFileName:

Object of class character A string constant containing the logical file name.

fileType:

Object of class character One of the following keywords, optionally followed by relevant options for that specific type of file: THOR/FLAT, CSV, XML, PIPE.

def:

Object of class character ECl definition/code.

inDataset:

Object of class ECLDataset The set of records to process. This may be the name of a dataset or a record set derived from some filter condition, or any expression that results in a derived record set.

format:

Object of class ECLRecord An output RECORD structure definition that defines the type, name, and source of the data for each field

Methods

getName():

Returns class name.

print():

Prints the ECL code.

The following methods are inherited (from the corresponding class): print ("ECLDataset"), getName ("ECLDataset"), getDatasetType ("ECLDataset"), addExpression ("ECLDataset")

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
   ## 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-class in rHpcc...