A lightweight, non-owning handle to one element of a parquet_string_column.
Holds a column pointer plus a 1-based index and resolves lazily on access, so it stays
valid across appends/reserve/shrink of the referenced column. It is invalidated by
erase (index shift), clear, move_from/swap, or the column going out of scope. The
referenced column must be declared with the target attribute and must outlive the handle.
Length of the referenced string.
Returns the length of the referenced string (0 for a null element).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
Whether the referenced string has zero length.
Returns whether the referenced string has zero length (.true. for a null element).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
||
| logical, | intent(in), | optional | :: | check_null |
.true. => error stop on a null element. |
Whether the referenced element is null.
Returns whether the referenced element is null.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
Sets the referenced column element to null.
Sets the referenced element to null (write-through: mutates the underlying column, not just this handle -- consistent with every other parquet_string accessor resolving live against the referenced column rather than holding independent state).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
Writes the referenced string into an argument.
Writes the referenced string into res. A null element error stops by default; pass
null_value to substitute a string, or allow_null=.true. to suppress the abort and
return an empty string (detect null via is_null).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
||
| character(len=:), | intent(out), | allocatable | :: | res |
the referenced string. |
|
| character(len=*), | intent(in), | optional | :: | null_value |
substitute for a null element. |
|
| logical, | intent(in), | optional | :: | allow_null |
.true. => suppress abort, return empty string for null. |
Exact comparison against str.
Exact comparison of the referenced string against str (see the column's equals).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
||
| character(len=*), | intent(in) | :: | str |
query string. |
||
| logical, | intent(in), | optional | :: | exact |
.false. => trailing-trim both sides. |
|
| logical, | intent(in), | optional | :: | check_null |
.true. => error stop on a null element. |
Substring search for str.
Substring search within the referenced string (see the column's contains).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
||
| character(len=*), | intent(in) | :: | str |
substring to search for. |
||
| logical, | intent(in), | optional | :: | check_null |
.true. => error stop on a null element. |
Prefix test.
Prefix test on the referenced string (see the column's startswith).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
||
| character(len=*), | intent(in) | :: | prefix |
prefix to test. |
||
| logical, | intent(in), | optional | :: | check_null |
.true. => error stop on a null element. |
Suffix test.
Suffix test on the referenced string (see the column's endswith).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
||
| character(len=*), | intent(in) | :: | suffix |
suffix to test. |
||
| logical, | intent(in), | optional | :: | check_null |
.true. => error stop on a null element. |
Human-readable representation.
Writes a human-readable representation of the referenced string to unit (default stdout).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parquet_string), | intent(in) | :: | self |
the handle. |
||
| integer, | intent(in), | optional | :: | unit |
output unit (default output_unit). |
type :: parquet_string private class(parquet_string_column), pointer :: col => null() !! referenced column (borrowed). integer(int64) :: idx = 0 !! 1-based element index. contains procedure :: length => psv_length !! Length of the referenced string. procedure :: is_empty => psv_is_empty !! Whether the referenced string has zero length. procedure :: is_null => psv_is_null !! Whether the referenced element is null. procedure :: set_null => psv_set_null !! Sets the referenced column element to null. procedure :: to_string => psv_to_string !! Writes the referenced string into an argument. procedure :: equals => psv_equals !! Exact comparison against str. procedure :: contains => psv_contains !! Substring search for str. procedure :: startswith => psv_startswith !! Prefix test. procedure :: endswith => psv_endswith !! Suffix test. procedure :: print => psv_print !! Human-readable representation. ! ! THIS TYPE DELIBERATELY HAS NO `final` PROCEDURE, and one must not be added for symmetry ! with parquet_string_column above -- that one owns buffers and genuinely needs to free ! them, whereas this is a NON-OWNING handle: a borrowed pointer and an index. It once ! carried `final :: finalize_handle`, whose entire body was `self%col => null()`; that is ! unobservable on every path finalization can occur (the object is either ceasing to exist ! or being wholly overwritten, and Fortran never auto-deallocates a pointer component, so ! there was nothing to release and no dangling reference the caller could still reach). ! ! Three things depend on the absence, so weigh them before reintroducing one: ! * nagfor 7.2 emits INVALID C under -C=undefined when finalizing an ARRAY whose element ! type has a finalizable COMPONENT -- so `type(t_row) :: rows(3)` holding one of these ! would not compile. See fpm.toml's nagdeb comment for the reproducer. ! * a finalizable type may not go in an OpenMP `private()` clause under gfortran (CLAUDE.md ! has the rule); handles staying non-finalizable is what keeps them usable there, which ! is the same reason parquet_table_row and parquet_table_col have no finalizer either. ! * intrinsic assignment to or from a finalizable type runs the finalizer twice per ! iteration, so `h = col%view(i)` in a user loop would pay for it on every element. end type parquet_string