Skip to content

Conversation

@morningman
Copy link
Contributor

cherry pick from #42200

…text insert and fix reading null string bug (apache#42200)

## Proposed changes
Add regression-test cases for hive text table properties:
| **Property** | **Description** | **Example Value** | **Supported in
Doris** |

|------------------------------|---------------------------------------------------------------------|-------------------|----------------------|
| `field.delim` | Defines the delimiter between columns in each row. |
`\1` | Yes |
| `collection.delim` | Defines the delimiter for items in an array
(collection type). | `\2` | Yes |
| `mapkey.delim` | Defines the delimiter between keys and values in a
map. | `\3` | Yes |
| `serialization.null.format` | Defines how `NULL` values are
represented in the text file. | `\\N` | Yes |
| `escape.delim` | Specifies the escape character used for escaping
special characters.| `\\` | Yes |
| `line.delim` | Defines the delimiter between rows or lines in the
file. | `\n` | Yes |

### Explanation:
- **`field.delim`**: This property is used to specify how columns are
separated in a row. For example, `\1` indicates the delimiter is a
non-printable character.
- **`collection.delim`**: Used to define how elements in an array or
collection are separated. In this case, `\2` is used as a separator.
- **`mapkey.delim`**: This property defines how keys and values in a map
are separated. For instance, `\3` is used to separate map keys and
values.
- **`serialization.null.format`**: This setting specifies the format for
`NULL` values in the data. `\\N` is commonly used to represent `NULL`.
- **`escape.delim`**: Defines the escape character used in the text file
for escaping special characters, such as the delimiter itself. Here,
`\\` is used as the escape character.
- **`line.delim`**: This property is used to specify the delimiter
between lines or rows. Typically, `\n` (newline) is used as the line
delimiter.
**Note**: Unlike the other delimiters, `line.delim` is not escaped. If
the content in the table contains the same character as the line
delimiter, it may cause query errors. However, the other delimiters
(`field.delim`, `collection.delim`, `mapkey.delim`) are escaped, so they
will not cause issues.
@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@morningman morningman merged commit 53ee740 into apache:branch-3.0 Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants