The SqlReader is a specialized SqlActor for executing select-statements only to load data from source tables. It may reference one or more tables with join relationship and produces one output view. Please note that the SqlReader can only run select-statements.
Actor Class: com.qwshen.etl.source.SqlReader
The definition for the SqlReader:
- In YAML format
actor:
type: sql-reader
properties:
sqlString: >
select
substr(row_value, 1, 12) as event_id,
substr(row_value, 13, 16) as event_time,
substr(row_value, 29, 12) as event_host,
substr(row_value, 41, 64) as event_location
from events_raw
where row_no not in (1, 2)
or
actor:
type: sql-reader
properties:
sqlFile: scripts/event_raw.sql
- In JSON format
{
"actor": {
"type": "sql-reader",
"properties": {
"sqlString": "select * from events_raw"
}
}
}
or
{
"actor": {
"type": "sql-reader",
"properties": {
"sqlFile": "scripts/event_raw.sql"
}
}
}
- In XML format
<actor type="sql-reader">
<properties>
<sqlString>
select
substr(row_value, 1, 12) as event_id,
substr(row_value, 13, 16) as event_time,
substr(row_value, 29, 12) as event_host,
substr(row_value, 41, 64) as event_location
from events_raw
where row_no not in (1, 2)
</sqlString>
</properties>
</actor>
or
<actor type="sql-reader">
<properties>
<sqlFile>scripts/event_raw.sql</sqlFile>
</properties>
</actor>