embulk-output-teradata 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -10
  3. data/build.gradle +2 -2
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a288a2445312c0e19442c069a0efc45753d03a49
4
- data.tar.gz: c9d893da755a2b8a31628ac0de463fa741d6cdc2
3
+ metadata.gz: f842427d2bb1abc2570877c1f67c24d3815667e9
4
+ data.tar.gz: 4e2029b8b0a6690025c81799cc175b6025f4aadb
5
5
  SHA512:
6
- metadata.gz: 6eaaa9cb605bcd6f8acd57f06156236a50a5fe10db7e25f16d82a8f85aede7f4dd6bf2441e48941eae89275c55357bdb83a74fc978f0af31b52c1db7eb0a86a4
7
- data.tar.gz: 0a910e828853f8f36394c6ac11260be691fe8814f2381853971149c0c051683d096ba48106eef1e73c59dc7e2a45c7c91c680ee85dd093d95571f85710545da5
6
+ metadata.gz: 911f4df3c54ffcb1b9961250cf001a2c7f129bd06f5d24c6060c58367ec9e9c8c3ce36107827cf841c994676d057556feab03110b0b2df41ed8fe1c5dc3a6906
7
+ data.tar.gz: e197945ceb751127d85af9eaf6cf2ed7a276befdfe1c6db9d40d8b7a0d2998d19eae05505e3014b67033bc259ec6965fbb9646fa91b7da7bf2ee9ac50eaee0a1
data/README.md CHANGED
@@ -1,32 +1,94 @@
1
1
  # Teradata output plugin for Embulk
2
2
 
3
- TODO: Write short description here and build.gradle file.
3
+ Teradata output plugin for Embulk loads records to a database using a Teradata JDBC driver. If the database follows ANSI SQL standards and JDBC standards strictly, this plugin works. But because of many incompatibilities, use case of this plugin is very limited. It's recommended to use specific plugins for the databases.
4
4
 
5
5
  ## Overview
6
6
 
7
7
  * **Plugin type**: output
8
- * **Load all or nothing**: no
9
- * **Resume supported**: no
10
- * **Cleanup supported**: yes
8
+ * **Load all or nothing**: depends on the mode. see below.
9
+ * **Resume supported**: depends on the mode. see below.
11
10
 
12
11
  ## Configuration
13
12
 
14
- - **option1**: description (integer, required)
15
- - **option2**: description (string, default: `"myvalue"`)
16
- - **option3**: description (string, default: `null`)
13
+ - **url**: URL of the JDBC connection (e.g. 'jdbc:teradata://127.0.0.1') (string, required)
14
+ - **user**: database login user name (string, optional)
15
+ - **password**: database login password (string, optional)
16
+ - **schema**: destination schema name (string, default: use default schema)
17
+ - **table**: destination table name (string, required)
18
+ - **options**: extra JDBC properties (hash, default: {})
19
+ - **retry_limit** max retry count for database operations (integer, default: 12)
20
+ - **retry_wait** initial retry wait time in milliseconds (integer, default: 1000 (1 second))
21
+ - **max_retry_wait** upper limit of retry wait, which will be doubled at every retry (integer, default: 1800000 (30 minutes))
22
+ - **mode**: "insert", "insert_direct", "truncate_insert", or "replace". See below (string, required)
23
+ - **batch_size**: size of a single batch insert (integer, default: 16777216)
24
+ - **max_table_name_length**: maximum length of table name in this RDBMS (integer, default: 256)
25
+ - **default_timezone**: If input column type (embulk type) is timestamp, this plugin needs to format the timestamp into a SQL string. This default_timezone option is used to control the timezone. You can overwrite timezone for each columns using column_options option. (string, default: `UTC`)
26
+ - **column_options**: advanced: a key-value pairs where key is a column name and value is options for the column.
27
+ - **type**: type of a column when this plugin creates new tables (e.g. `VARCHAR(255)`, `INTEGER NOT NULL UNIQUE`). This used when this plugin creates intermediate tables (insert and truncate_insert modes), when it creates the target table (replace mode), and when it creates nonexistent target table automatically. (string, default: depends on input column type. `BIGINT` if input column type is long, `BOOLEAN` if boolean, `DOUBLE PRECISION` if double, `CLOB` if string, `TIMESTAMP` if timestamp)
28
+ - **value_type**: This plugin converts input column type (embulk type) into a database type to build a INSERT statement. This value_type option controls the type of the value in a INSERT statement. (string, default: depends on the sql type of the column. Available values options are: `byte`, `short`, `int`, `long`, `double`, `float`, `boolean`, `string`, `nstring`, `date`, `time`, `timestamp`, `decimal`, `json`, `null`, `pass`)
29
+ - **timestamp_format**: If input column type (embulk type) is timestamp and value_type is `string` or `nstring`, this plugin needs to format the timestamp value into a string. This timestamp_format option is used to control the format of the timestamp. (string, default: `%Y-%m-%d %H:%M:%S.%6N`)
30
+ - **timezone**: If input column type (embulk type) is timestamp, this plugin needs to format the timestamp value into a SQL string. In this cases, this timezone option is used to control the timezone. (string, value of default_timezone option is used by default)
31
+ - **after_load**: if set, this SQL will be executed after loading all records.
32
+
33
+ ## Modes
34
+
35
+ * **insert**:
36
+ * Behavior: This mode writes rows to some intermediate tables first. If all those tasks run correctly, runs `INSERT INTO <target_table> SELECT * FROM <intermediate_table_1> UNION ALL SELECT * FROM <intermediate_table_2> UNION ALL ...` query. If the target table doesn't exist, it is created automatically.
37
+ * Transactional: Yes. This mode successfully writes all rows, or fails with writing zero rows.
38
+ * Resumable: Yes.
39
+ * **insert_direct**:
40
+ * Behavior: This mode inserts rows to the target table directly. If the target table doesn't exist, it is created automatically.
41
+ * Transactional: No. If fails, the target table could have some rows inserted.
42
+ * Resumable: No.
43
+ * **truncate_insert**:
44
+ * Behavior: Same with `insert` mode excepting that it truncates the target table right before the last `INSERT ...` query.
45
+ * Transactional: Yes.
46
+ * Resumable: Yes.
47
+ * **replace**:
48
+ * Behavior: This mode writes rows to an intermediate table first. If all those tasks run correctly, drops the target table and alters the name of the intermediate table into the target table name.
49
+ * Transactional: No. If fails, the target table could be dropped.
50
+ * Resumable: No.
51
+ * **merge**:
52
+ * Behavior: This mode writes rows to some intermediate tables first. If all those tasks run correctly, merges the intermediate tables into the target table. Namely, if primary keys of a record in the intermediate tables already exist in the target table, the target record is updated by the intermediate record, otherwise the intermediate record is inserted. If the target table doesn't exist, it is created automatically.
53
+ * Transactional: Yes.
54
+ * Resumable: Yes.
55
+ * **merge_direct**:
56
+ * Behavior: This mode merges rows to the target table directly. Namely, if primary keys of an input record already exist in the target table, the target record is updated by the input record, otherwise the input record is inserted. If the target table doesn't exist, it is created automatically.
57
+ * Transactional: No.
58
+ * Resumable: No.
17
59
 
18
60
  ## Example
19
61
 
20
62
  ```yaml
21
63
  out:
22
64
  type: teradata
23
- option1: example1
24
- option2: example2
65
+ url: jdbc:teradata://127.0.0.1
66
+ user: myuser
67
+ password: "mypassword"
68
+ table: my_table
69
+ mode: insert
25
70
  ```
26
71
 
72
+ Advanced configuration:
73
+
74
+ ```yaml
75
+ out:
76
+ type: teradata
77
+ url: jdbc:teradata://127.0.0.1
78
+ user: myuser
79
+ password: "mypassword"
80
+ table: my_table
81
+ options: {loglevel: 2}
82
+ mode: insert_direct
83
+ column_options:
84
+ my_col_1: {type: 'VARCHAR(255)'}
85
+ my_col_3: {type: 'INT NOT NULL'}
86
+ my_col_4: {value_type: string, timestamp_format: `%Y-%m-%d %H:%M:%S %z`, timezone: '-0700'}
87
+ my_col_5: {type: 'DECIMAL(18,9)', value_type: pass}
88
+ ```
27
89
 
28
90
  ## Build
29
91
 
30
92
  ```
31
- $ ./gradlew gem # -t to watch change of files and rebuild continuously
93
+ $ ./gradlew gem
32
94
  ```
data/build.gradle CHANGED
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.1"
16
+ version = "0.1.2"
17
17
 
18
18
  sourceCompatibility = 1.7
19
19
  targetCompatibility = 1.7
@@ -80,7 +80,7 @@ Gem::Specification.new do |spec|
80
80
  spec.description = %[Dumps records to Teradata.]
81
81
  spec.email = ["ebyhry@gmail.com"]
82
82
  spec.licenses = ["MIT"]
83
- spec.homepage = "https://github.com/ebyhry/embulk-output-teradata"
83
+ spec.homepage = "https://github.com/ebyhr/embulk-output-teradata"
84
84
 
85
85
  spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
86
86
  spec.test_files = spec.files.grep(%r"^(test|spec)/")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-teradata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ebyhr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-14 00:00:00.000000000 Z
11
+ date: 2017-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -98,10 +98,10 @@ files:
98
98
  - src/main/java/org/embulk/output/teradata/jdbc/setter/SqlTimestampColumnSetter.java
99
99
  - src/main/java/org/embulk/output/teradata/jdbc/setter/StringColumnSetter.java
100
100
  - src/test/java/org/embulk/output/teradata/TestTeradataOutputPlugin.java
101
- - classpath/embulk-output-teradata-0.1.1.jar
101
+ - classpath/embulk-output-teradata-0.1.2.jar
102
102
  - classpath/tdgssconfig.jar
103
103
  - classpath/terajdbc4.jar
104
- homepage: https://github.com/ebyhry/embulk-output-teradata
104
+ homepage: https://github.com/ebyhr/embulk-output-teradata
105
105
  licenses:
106
106
  - MIT
107
107
  metadata: {}