lib/td/client/api/table.rb in td-client-1.0.4 vs lib/td/client/api/table.rb in td-client-1.0.5

- old
+ new

@@ -23,20 +23,22 @@ last_import = m['counter_updated_at'] last_log_timestamp = m['last_log_timestamp'] estimated_storage_size = m['estimated_storage_size'].to_i schema = JSON.parse(m['schema'] || '[]') expire_days = m['expire_days'] - result[name] = [type, schema, count, created_at, updated_at, estimated_storage_size, last_import, last_log_timestamp, expire_days] + include_v = m['include_v'] + result[name] = [type, schema, count, created_at, updated_at, estimated_storage_size, last_import, last_log_timestamp, expire_days, include_v] } return result end # @param [String] db # @param [String] table + # @param [Hash] params # @return [true] - def create_log_table(db, table) - create_table(db, table, :log) + def create_log_table(db, table, params={}) + create_table(db, table, :log, params) end # @param [String] db # @param [String] table # @param [String] type @@ -79,12 +81,22 @@ # @param [String] db # @param [String] table # @param [Fixnum] expire_days # @return [true] def update_expire(db, table, expire_days) - code, body, res = post("/v3/table/update/#{e db}/#{e table}", {'expire_days'=>expire_days}) + update_table(db, table, {:expire_days=>expire_days}) + end + + # @param [String] db + # @param [String] table + # @option params [Fixnum] :expire_days days to expire table + # @option params [Boolean] :include_v (true) include v column on Hive + # @option params [Boolean] :detect_schema (true) detect schema on import + # @return [true] + def update_table(db, table, params={}) + code, body, res = post("/v3/table/update/#{e db}/#{e table}", params) if code != "200" - raise_error("Update table expiration failed", res) + raise_error("Update table failed", res) end return true end # @param [String] db