Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.IntStream;

import org.jooq.Context;
import org.jooq.DataType;
import org.jooq.Field;
import org.jooq.Record;
import org.jooq.RenderContext.CastMode;
import org.jooq.Select;
import org.jooq.Table;

import static org.jooq.impl.Keywords.K_VALUES;
import static org.jooq.impl.Tools.BooleanDataKey.DATA_STORE_ASSIGNMENT;

Expand Down Expand Up @@ -78,10 +80,9 @@ public Select<Record> upsertSelect() {
Map<Field<?>, List<Field<?>>> v = valuesFlattened();

return IntStream.range(0, rows)
.mapToObj(row -> (Select<Record>) DSL.select(Tools.map(v.entrySet(),
e -> patchDefault0(e.getValue().get(row), e.getKey()))))
.mapToObj(row -> (Select<Record>) DSL.select(Tools.map(v.entrySet(), e -> patchDefault0(e.getValue().get(row), e.getKey()))))
.reduce(Select::unionAll)
.orElse(null);
.orElseThrow();
}

private void toSQL92Values(Context<?> ctx) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package tech.ydb.jooq.codegen;

import java.util.ArrayList;
import java.util.List;

import org.jooq.SortOrder;
import org.jooq.meta.AbstractIndexDefinition;
import org.jooq.meta.ColumnDefinition;
import org.jooq.meta.DefaultIndexColumnDefinition;
import org.jooq.meta.IndexColumnDefinition;
import org.jooq.meta.SchemaDefinition;
import org.jooq.meta.TableDefinition;
import tech.ydb.table.description.TableIndex;

import java.util.ArrayList;
import java.util.List;
import tech.ydb.table.description.TableIndex;

public class YdbIndexDefinition extends AbstractIndexDefinition {
private final TableIndex tableIndex;
Expand All @@ -29,6 +30,9 @@ protected List<IndexColumnDefinition> getIndexColumns0() {

for (String column : columns) {
ColumnDefinition columnDefinition = getTable().getColumn(column);
if (columnDefinition == null) {
continue;
}

IndexColumnDefinition definition = new DefaultIndexColumnDefinition(
this,
Expand Down