(Context<?> ctx)
| 116 | } |
| 117 | |
| 118 | @Override |
| 119 | public final void accept(Context<?> ctx) { |
| 120 | switch (ctx.family()) { |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | case DUCKDB: |
| 128 | ctx.visit(cardinality(function(N_ARRAY_INTERSECT, array1.getDataType(), array1, array2)).gt(inline(0))); |
| 129 | break; |
| 130 | |
| 131 | case H2: |
| 132 | ctx.visit(exists( |
| 133 | select(asterisk()).from(unnest(array1)) |
| 134 | .intersect(select(asterisk()).from(unnest(array2))) |
| 135 | )); |
| 136 | break; |
| 137 | |
| 138 | |
| 139 | |
| 140 | case HSQLDB: |
| 141 | ctx.visit(exists( |
| 142 | select(asterisk()).from(unnest(array1)) |
| 143 | .intersectAll(select(asterisk()).from(unnest(array2))) |
| 144 | )); |
| 145 | break; |
| 146 | |
| 147 | |
| 148 | case TRINO: |
| 149 | ctx.visit(function(N_ARRAYS_OVERLAP, BOOLEAN, array1, array2)); |
| 150 | break; |
| 151 | |
| 152 | default: |
| 153 | ctx.sql('(').visit(array1).sql(" && ").visit(array2).sql(')'); |
| 154 | break; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | |
| 159 |
nothing calls this directly
no test coverage detected