Skip to content

Commit 2474f19

Browse files
committed
time-column option is obsolute
1 parent e5f207d commit 2474f19

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

lib/td/command/connector.rb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,34 +108,30 @@ def connector_preview(op)
108108
end
109109

110110
def connector_issue(op)
111-
option_database = option_table = nil
112-
time_column = nil
113-
wait = exclude = false
114-
auto_create = false
111+
wait = exclude = false
112+
auto_create = false
113+
config_option = {}
115114

116-
on_with_obsolute_and_overwrite_config_warning(op, '--database DB_NAME') { |s| option_database = s }
117-
on_with_obsolute_and_overwrite_config_warning(op, '--table TABLE_NAME') { |s| option_table = s }
115+
on_with_obsolute_and_overwrite_config_warning(op, '--database DB_NAME') { |s| config_option['database'] = s }
116+
on_with_obsolute_and_overwrite_config_warning(op, '--table TABLE_NAME') { |s| config_option['table'] = s }
117+
on_with_obsolute_and_overwrite_config_warning(op, '--time-column COLUMN_NAME') { |s| config_option['time_column'] = s }
118118

119-
op.on('--time-column COLUMN_NAME', "data partitioning key") { |s| time_column = s } # unnecessary but for backward compatibility
120119
op.on('-w', '--wait', 'wait for finishing the job', TrueClass) { |b| wait = b }
121120
op.on('-x', '--exclude', 'do not automatically retrieve the job result', TrueClass) { |b| exclude = b }
122121
op.on('--auto-create-table', "Create table and database if doesn't exist", TrueClass) { |b|
123122
auto_create = b
124123
}
125124

126-
database, table, config_file = nil
127125
args = op.cmd_parse
128126

129127
if args.instance_of? String
130128
config_file = args
131-
database = option_database
132-
table = option_table
133129
else
134-
database, table, config_file = args
130+
config_option['database'], config_option['table'], config_file = args
135131
end
136132

137133
config = prepare_bulkload_job_config(config_file)
138-
overwrite_out_config(config, 'database' => database, 'table' => table, 'time_column' => time_column)
134+
overwrite_out_config(config, config_option)
139135

140136
client = get_client()
141137

0 commit comments

Comments
 (0)