class ScriptGen extends StrictLogging
- Alphabetic
- By Inheritance
- ScriptGen
- StrictLogging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ScriptGen(storageHandler: StorageHandler, schemaHandler: SchemaHandler, launchHandler: LaunchHandler)(implicit settings: Settings)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val engine: TemplateEngine
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
generateDomain(domain: Domain, scriptTemplateFile: File, scriptsOutputPath: File, scriptOutputPattern: Option[String], defaultDeltaColumn: Option[String], deltaColumns: Map[String, String]): List[File]
Generate all extraction scripts based on the given domain
Generate all extraction scripts based on the given domain
- domain
The domain extracted from the Excel referential file
- scriptTemplateFile
The script template
- scriptsOutputPath
Where the scripts are produced
- defaultDeltaColumn
Defaut delta column
- deltaColumns
Mapping table name -> delta column, has precedence over
defaultDeltaColumn- returns
The list of produced files
-
def
generateJob(job: AutoJobDesc, scriptTemplateFile: File, scriptsOutputFolder: File, scriptOutputPattern: Option[String]): File
Generate all extraction scripts based on the given domain
Generate all extraction scripts based on the given domain
- job
The job extracted from the yml file
- scriptTemplateFile
The script template
- returns
The list of produced files
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
logger: Logger
- Attributes
- protected
- Definition Classes
- StrictLogging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def run(config: ExtractScriptGenConfig)(implicit settings: Settings): Boolean
-
def
run(args: Array[String]): Boolean
Fills a Mustache templated file based on a given domain.
Fills a Mustache templated file based on a given domain. The following documentation considers that we use the script to generate SQL export files.
The schemas should at least, specify :
- a table name (schemas.name)
- a file pattern (schemas.pattern) which is used as the export file base name
- a write mode (schemas.metadata.write): APPEND or OVERWRITE
- the columns to extract (schemas.attributes.name*)
You also have to provide a Mustache (http://mustache.github.io/mustache.5.html) template file.
Here you'll write your extraction export process (sqlplus for Oracle, pgsql for PostgreSQL as an example). In that template you can use the following parameters:
table_name -> the table to export delimiter -> the resulting dsv file delimiter columns -> the columns to export columns is a Mustache map, it gives you access, for each column, to:
- name -> the column name
- trailing_col_char -> the separator to append to the column (, if there are more columns to come, "" otherwise) Here is an example how to use it in a template: SELECT {{#columns}} TO_CHAR({{name}}){{trailing_col_char}} {{/columns}} FROM {{table_name}}; export_file -> the export file name delta_column -> a delta date column (passed as a Main arg or as a config element), the column which is used to determine new rows for each exports in APPEND mode full_export -> if the export is a full or delta export (the logic is to be implemented in your script)
Usage: comet [script-gen] [options]
Command: script-gen --domain <value> The domain for which to generate extract scripts --templateFile <value> Script template file --scriptsOutputDir <value> Scripts output folder --deltaColumn <value> The date column which is used to determine new rows for each exports (can be passed table by table as config element)
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
templatize(template: File, templateParams: TemplateParams): String
Generate an extraction script payload based on a template and its params
Generate an extraction script payload based on a template and its params
- template
The extraction script template
- templateParams
Its params
- returns
The produced script payload
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()