Skip to content

fix(QTDI-1559): Output component does not populate inner record correctly in studio #1059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -475,11 +475,6 @@ private void onArray(final Entry entry, final Collection value) {
}

private void onObject(final String name, final Object value) {
if (Record.class.isInstance(value)) {// keep old action here
recordBuilder.withString(name, jsonb.toJson(value));
return;
}

recordBuilder.with(rowStructSchema.getEntry(name), value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ void visit() {
createMetadata(dynamic, "BYTES", StudioTypes.LIST, BYTES);
createMetadata(dynamic, "DATES", StudioTypes.LIST, DATES);
createMetadata(dynamic, "RECORDS", StudioTypes.LIST, RECORDS);
createMetadata(dynamic, "RECORD", StudioTypes.OBJECT, RECORD);
createMetadata(dynamic, "RECORD_SUB", StudioTypes.OBJECT, RECORD_WITH_SUB);
createMetadata(dynamic, "BIG_DECIMALS", StudioTypes.LIST, BIG_DECIMALS);
createMetadata(dynamic, "dynDate", StudioTypes.DATE, DATE);
createMetadata(dynamic, "dynStringDate", StudioTypes.STRING,
Expand All @@ -141,7 +143,7 @@ void visit() {
final Record record = visitor.get(rowStruct, factory);
final Schema schema = record.getSchema();
// should have 3 excluded fields
assertEquals(58, schema.getEntries().size());
assertEquals(60, schema.getEntries().size());

// schema metadata
assertFalse(schema.getEntry("id").isNullable());
Expand Down Expand Up @@ -219,6 +221,8 @@ void visit() {
assertEquals(String.valueOf(Character.MAX_VALUE), record.getString("char0"));
assertEquals(dynObject, record.get(Object.class, "dynObject"));
assertEquals(STRINGS, record.getArray(String.class, "STRINGS"));
assertEquals(RECORD, record.get(Record.class, "RECORD"));
assertEquals(RECORD_WITH_SUB, record.get(Record.class, "RECORD_SUB"));
assertEquals(LONGS, record.getArray(Long.class, "LONGS"));
assertEquals(FLOATS, record.getArray(Float.class, "FLOATS"));
assertEquals(DOUBLES, record.getArray(Double.class, "DOUBLES"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public class VisitorsTest {
protected static final Record RECORD =
factory.newRecordBuilder().withInt("ntgr", 1).withString("str", "one").build();

protected static final Record RECORD_WITH_SUB =
factory.newRecordBuilder().withInt("ntgr", 1).withRecord("record1", RECORD).build();

protected static final Object OBJECT = new Object();

protected static final Document DOCUMENT = new Document();
Expand Down
Loading