MCPcopy Create free account
hub / github.com/apache/arrow / append

Method append

ruby/red-arrow/lib/arrow/array-builder.rb:240–287  ·  view source on GitHub ↗

@since 0.12.0

(*values)

Source from the content-addressed store, hash-verified

238
239 # @since 0.12.0
240 def append(*values)
241 value_convertable = respond_to?(:convert_to_arrow_value, true)
242 start_index = 0
243 current_index = 0
244 status = :value
245
246 values.each do |value|
247 if value.nil?
248 if status == :value
249 if start_index != current_index
250 target_values = values[start_index...current_index]
251 if value_convertable
252 target_values = target_values.collect do |v|
253 convert_to_arrow_value(v)
254 end
255 end
256 append_values(target_values, nil)
257 start_index = current_index
258 end
259 status = :null
260 end
261 else
262 if status == :null
263 append_nulls(current_index - start_index)
264 start_index = current_index
265 status = :value
266 end
267 end
268 current_index += 1
269 end
270 if start_index != current_index
271 if status == :value
272 if start_index == 0 and current_index == values.size
273 target_values = values
274 else
275 target_values = values[start_index...current_index]
276 end
277 if value_convertable
278 target_values = target_values.collect do |v|
279 convert_to_arrow_value(v)
280 end
281 end
282 append_values(target_values, nil)
283 else
284 append_nulls(current_index - start_index)
285 end
286 end
287 end
288 end
289end

Callers 15

leave_ModuleMethod · 0.45
visit_ClassDefMethod · 0.45
visit_FunctionDefMethod · 0.45
_make_signatureFunction · 0.45
top_k_unstableFunction · 0.45
bottom_k_unstableFunction · 0.45
fs.pyFile · 0.45
get_file_infoMethod · 0.45

Calls 2

eachMethod · 0.45
sizeMethod · 0.45

Tested by 15

test_table_basicsFunction · 0.36
sorted_by_keysFunction · 0.36
test_recordbatch_non_cpuFunction · 0.36
test_table_non_cpuFunction · 0.36
_check_pandas_roundtripFunction · 0.36
_check_arrow_roundtripFunction · 0.36
_assert_error_on_writeFunction · 0.36
test_read_tableFunction · 0.36
test_use_threadsFunction · 0.36
test_float_nullsFunction · 0.36