# README
Transformation Components
SQL Query (Table Input)
- Input is a SQL statement.
- Output rows to a channel of
map[string]interface{}
, where the map keys are the SQL column names.
SQL Query with Arguments (Table Input)
- Input is a SQL statement with bind variables populated by another (prior) SQL statement.
- Output rows to a channel of
map[string]interface{}
, where the map keys are the SQL column names.
Stream Lookup - Join Tables A & B (1:n)
- Input is two SQL row channels that can join by common field(s), where the cardinality of parent-child data
is
1:n
. Take the child rows and build a[]map[string]interface{}
before adding it to the parent row map. - The channels must be sorted by the common join field(s) for this to work. E.g. use SQL
order by
to achieve this. - Output results to a channel of
map[string]interface{}
so further processing can be performed by other steps. - The map keys are the column names and these are case sensitive.
Table Diff / Merge Diff
- Input is two channels containing an ordered stream of records of type
map[string]interface{}
: one with old data, one with new data. Use the table input steps above as input. - Output
map[string]interface{}
per row with an added flag field showing whether a record is NEW, CHANGED or DELETED or IDENTICAL. This output can feed into the Table Sync or Merge step below. Output of IDENTICAL rows is optional.
Table Sync (Table Output)
- Input is one channel of records containing both table data fields and a flag field from the Table Diff / Merge Diff step above.
- Output is database writes for the field changes to a RDBMS table where NEW rows cause INSERTs, CHANGED rows cause UPDATEs and DELETED rows cause DELETEs. IDENTICAL rows are ignored. Transaction size is configurable.
Table Merge (Table Output)
- Input is one channel of records containing table data fields. E.g. Data from the Table Input step above.
- Output is SQL MERGE statements executed.
# Functions
GetSqlSliceSnowflakeCopyInto generates SQL to copy data from the supplied Snowflake STAGE/fileName into the given tableName.
GetSqlSliceSnowflakeSyncTable will return a slice of SQL statements required to sync data from a given fileName into the target table where.
GetSqlSliceSnowflakeSyncTable will return a slice of SQL statements required to sync data from a given fileName into the target table where.
No description provided by the author
NewChannelBridge returns an input channel upon which it waits to be given a chan StreamRecordIface to read from.
NewChannelCombiner will accept 2 input channels and collect all rows onto the outputChan.
NewCopyFilesToS3 copies os files to S3.
NewCqnWithArgs registers a Continuous Query Notification with the Oracle database connection provided.
NewCsvFileWriter will dump cfg.InputChan to a CSV with spec defined in cfg.
NewDateRangeGenerator will: Read the input chan to get the FromDate(s).
NewFieldMapper uses FieldMapperConfig to map fields in records read from InputChan.
NewFilterRows accepts a FilterRowsConfig{} and outputs rows if they match the given filter.
No description provided by the author
NewManifestWriter is expected to be used after CSV file generation.
Produce an output channel (chanOutput) of records based on the map[string]interface{} data found in chanOld and chanNew.
NewChannelMerge will consume all records from InputChan2 into memory and then add use them to profield curValues from those records to all records on InputChan1 producing a cartesian product.
NewNumberRangeGenerator will: Read the input chan to get the LowNum and HighNum, per input row.
NewS3BucketList fetches the list of objects from the given S3 bucket and produces records onto the output channel where each record on the channel has: map key name = ChanField4FileName (or the default mentioned above) map value = the file name found in S3 TODO: add a test for filtering by filename prefix (not bucket prefix).
NewManifestReader will open manifest files expected to be found on the S3 bucket specified and output the contents of the manifest files to outputChan.
NewSnowflakeLoader reads the input channel of records expecting it to contain the following: 1) the data file name on S3 that exists via..
No description provided by the author
No description provided by the author
No description provided by the author
Execute SQL and fetch rows onto the output channel.
Execute SQL and fetch rows onto the output channel.
NewSqlQueryWithReplace will execute SQL with args, but replace strings within the supplied SQL first.
NewStdOutPassThrough prints input records found on the InputChan to STDOUT and passes them on to the output channel outputChan.
NewTableMerge will apply the output of a prior MergeDiff step to a target database table using SQL MERGE statements (instead of choosing the appropriate INSERT, UPDATE or DELETE).
NewTableSync can be used to apply the output of a MergeDiff step to a target database table.
# Variables
Default field names are used by components to know the names of input and output fields.
# Structs
No description provided by the author
No description provided by the author
ColumnType contains the name and type of a column.
ComponentStep is a generic holder for FieldMapper config.
ControlAction is used to communicate with components.
No description provided by the author
CqnDownstreamSnowflakeSync implements CqnDownstreamSyncer.
CqnDownstreamTableSync implements CqnDownstreamSyncer.
Oracle Continuous Query Notification Input Step.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StdOutPassThroughConfig should return a slice of SQL statements for NewSnowflakeLoader to execute.
No description provided by the author
No description provided by the author
# Interfaces
ComponentWaiter is a simple interface for use around a wait group.
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SnowflakeSqlBuilderFunc should return a slice of SQL statements for NewSnowflakeLoader to execute.