MCPcopy Create free account
hub / github.com/apache/datafusion / col_str

Function col_str

datafusion/core/tests/sql/mod.rs:207–218  ·  view source on GitHub ↗

Specialized String representation

(column: &ArrayRef, row_index: usize)

Source from the content-addressed store, hash-verified

205
206/// Specialized String representation
207fn col_str(column: &ArrayRef, row_index: usize) -> String {
208 // NullArray::is_null() does not work on NullArray.
209 // can remove check for DataType::Null when
210 // https://github.com/apache/arrow-rs/issues/4835 is fixed
211 if column.data_type() == &DataType::Null || column.is_null(row_index) {
212 return "NULL".to_string();
213 }
214
215 array_value_to_string(column, row_index)
216 .ok()
217 .unwrap_or_else(|| "???".to_string())
218}
219
220/// Converts the results into a 2d array of strings, `result[row][column]`
221/// Special cases nulls to NULL for testing

Callers 1

result_vecFunction · 0.85

Calls 3

data_typeMethod · 0.45
is_nullMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…