|
64 | 64 |
|
65 | 65 | '''
|
66 | 66 | # ---
|
| 67 | +# name: test_partial_match_query_construction[MyObject-False] |
| 68 | + ''' |
| 69 | + SELECT |
| 70 | + timestamp, |
| 71 | + resource_attributes:"snow.database.name"::string as database_name, |
| 72 | + resource_attributes:"snow.schema.name"::string as schema_name, |
| 73 | + resource_attributes:"snow.table.name"::string as object_name, |
| 74 | + record:severity_text::string as log_level, |
| 75 | + value::string as log_message |
| 76 | + FROM SNOWFLAKE.TELEMETRY.EVENTS |
| 77 | + WHERE record_type = 'LOG' |
| 78 | + AND (record:severity_text IN ('INFO', 'WARN', 'ERROR', 'FATAL') or record:severity_text is NULL ) |
| 79 | + AND object_name = 'MyObject' |
| 80 | + AND timestamp >= TO_TIMESTAMP_LTZ('2022-02-02T02:02:02') |
| 81 | + AND timestamp <= TO_TIMESTAMP_LTZ('2022-02-03T02:02:02') |
| 82 | + |
| 83 | + ORDER BY timestamp; |
| 84 | + ''' |
| 85 | +# --- |
| 86 | +# name: test_partial_match_query_construction[MyObject-True] |
| 87 | + ''' |
| 88 | + SELECT |
| 89 | + timestamp, |
| 90 | + resource_attributes:"snow.database.name"::string as database_name, |
| 91 | + resource_attributes:"snow.schema.name"::string as schema_name, |
| 92 | + resource_attributes:"snow.table.name"::string as object_name, |
| 93 | + record:severity_text::string as log_level, |
| 94 | + value::string as log_message |
| 95 | + FROM SNOWFLAKE.TELEMETRY.EVENTS |
| 96 | + WHERE record_type = 'LOG' |
| 97 | + AND (record:severity_text IN ('INFO', 'WARN', 'ERROR', 'FATAL') or record:severity_text is NULL ) |
| 98 | + AND object_name ILIKE '%MyObject%' |
| 99 | + AND timestamp >= TO_TIMESTAMP_LTZ('2022-02-02T02:02:02') |
| 100 | + AND timestamp <= TO_TIMESTAMP_LTZ('2022-02-03T02:02:02') |
| 101 | + |
| 102 | + ORDER BY timestamp; |
| 103 | + ''' |
| 104 | +# --- |
| 105 | +# name: test_partial_match_query_construction[test_obj-False] |
| 106 | + ''' |
| 107 | + SELECT |
| 108 | + timestamp, |
| 109 | + resource_attributes:"snow.database.name"::string as database_name, |
| 110 | + resource_attributes:"snow.schema.name"::string as schema_name, |
| 111 | + resource_attributes:"snow.table.name"::string as object_name, |
| 112 | + record:severity_text::string as log_level, |
| 113 | + value::string as log_message |
| 114 | + FROM SNOWFLAKE.TELEMETRY.EVENTS |
| 115 | + WHERE record_type = 'LOG' |
| 116 | + AND (record:severity_text IN ('INFO', 'WARN', 'ERROR', 'FATAL') or record:severity_text is NULL ) |
| 117 | + AND object_name = 'test_obj' |
| 118 | + AND timestamp >= TO_TIMESTAMP_LTZ('2022-02-02T02:02:02') |
| 119 | + AND timestamp <= TO_TIMESTAMP_LTZ('2022-02-03T02:02:02') |
| 120 | + |
| 121 | + ORDER BY timestamp; |
| 122 | + ''' |
| 123 | +# --- |
| 124 | +# name: test_partial_match_query_construction[test_obj-True] |
| 125 | + ''' |
| 126 | + SELECT |
| 127 | + timestamp, |
| 128 | + resource_attributes:"snow.database.name"::string as database_name, |
| 129 | + resource_attributes:"snow.schema.name"::string as schema_name, |
| 130 | + resource_attributes:"snow.table.name"::string as object_name, |
| 131 | + record:severity_text::string as log_level, |
| 132 | + value::string as log_message |
| 133 | + FROM SNOWFLAKE.TELEMETRY.EVENTS |
| 134 | + WHERE record_type = 'LOG' |
| 135 | + AND (record:severity_text IN ('INFO', 'WARN', 'ERROR', 'FATAL') or record:severity_text is NULL ) |
| 136 | + AND object_name ILIKE '%test\\_obj%' |
| 137 | + AND timestamp >= TO_TIMESTAMP_LTZ('2022-02-02T02:02:02') |
| 138 | + AND timestamp <= TO_TIMESTAMP_LTZ('2022-02-03T02:02:02') |
| 139 | + |
| 140 | + ORDER BY timestamp; |
| 141 | + ''' |
| 142 | +# --- |
| 143 | +# name: test_partial_match_with_like_wildcards[test_obj_with_percent] |
| 144 | + ''' |
| 145 | + SELECT |
| 146 | + timestamp, |
| 147 | + resource_attributes:"snow.database.name"::string as database_name, |
| 148 | + resource_attributes:"snow.schema.name"::string as schema_name, |
| 149 | + resource_attributes:"snow.table.name"::string as object_name, |
| 150 | + record:severity_text::string as log_level, |
| 151 | + value::string as log_message |
| 152 | + FROM SNOWFLAKE.TELEMETRY.EVENTS |
| 153 | + WHERE record_type = 'LOG' |
| 154 | + AND (record:severity_text IN ('INFO', 'WARN', 'ERROR', 'FATAL') or record:severity_text is NULL ) |
| 155 | + AND object_name ILIKE '%test\\_obj\\_with\\_percent%' |
| 156 | + |
| 157 | + ORDER BY timestamp; |
| 158 | + ''' |
| 159 | +# --- |
| 160 | +# name: test_partial_match_with_like_wildcards[test_obj_with_underscore] |
| 161 | + ''' |
| 162 | + SELECT |
| 163 | + timestamp, |
| 164 | + resource_attributes:"snow.database.name"::string as database_name, |
| 165 | + resource_attributes:"snow.schema.name"::string as schema_name, |
| 166 | + resource_attributes:"snow.table.name"::string as object_name, |
| 167 | + record:severity_text::string as log_level, |
| 168 | + value::string as log_message |
| 169 | + FROM SNOWFLAKE.TELEMETRY.EVENTS |
| 170 | + WHERE record_type = 'LOG' |
| 171 | + AND (record:severity_text IN ('INFO', 'WARN', 'ERROR', 'FATAL') or record:severity_text is NULL ) |
| 172 | + AND object_name ILIKE '%test\\_obj\\_with\\_underscore%' |
| 173 | + |
| 174 | + ORDER BY timestamp; |
| 175 | + ''' |
| 176 | +# --- |
67 | 177 | # name: test_providing_time_in_incorrect_format_causes_error[2024-11-03 12:00:00 UTC---from]
|
68 | 178 | '''
|
69 | 179 | +- Error ----------------------------------------------------------------------+
|
|
0 commit comments