Test and Validate
The validator API endpoint allows you to test your transform with sample data. It will interpret both the transform and data and output how Hydrolix will parse and enrich it.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
The intermediate_data is the base64 JSON-encoded interpretation of the data, and the indexing SQL is what'sused as SQL statement to generate Hydrolix partitions based the data.
If there are any errors from any component, they'll be included in the response. For example, if the indexer isn't able to parse the timestamp or the format, it will output an error.
Delimiters in CSV format⚓︎
When sending in a transform in CSV format, make sure escaped characters are specified as an ASCII character code rather than the character. For example, to specify a tab delimiter, use the ASCII equivalent. Rather than:
Use the ASCII equivalent:
This applies to the sample transform formats found in Hydrolix's sample repository. While the CSV formats contained there will work with the Transforms API, some of them must be modified to work with this endpoint.
Use the catch_all Feature⚓︎
The catch_all feature allows you to see the shape of your data before you've applied a transform to it. For example, below is a transform with a mapping catchall, followed by three lines of sample data:
Here any JSON key value in the sample data will be interpreted as a map and put in the catchall column:
Use the catch_rejects Feature⚓︎
The catch_rejects attribute adds an extra filter to a transform. Invalid ingested data is added to a discrete column, while valid data is ingested as expected.
For example, assume you have a table with two columns.
| Name | Type |
|---|---|
| primary_column | DateTime |
| uint_column | Uint32 |
An example transform for this would look like the following:
If your ingested data contains fields with invalid values, these will be rejected entirely. The result may be a partial success, and return an error message.
You can use catch_rejects to separate the invalid values and pass the correct data by adding the attribute to the transform. This must be a string>string map.
Ingest the same data again, and you'll have three columns. The rejected_data column shows the invalid data, and the other two columns are populated with good data or null values.
| primary_column | rejected_data | uint_column |
|---|---|---|
| 2024-12-12 18:10:14 UTC | {'uint_column': '-2'} | null |
| 2024-12-12 18:10:14 UTC | {} | 1 |
| 2024-12-12 18:10:14 UTC | {'uint_column': '-1'} | null |
| 2024-12-12 18:10:14 UTC | {} | 2 |