Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Safus
Creator
Creator

@DiscoverSchema Fields Order Issue

Hi All,

someone is facing this problem with the @DiscoverSchema ?

The method in my service class is triggered and my schema is created, but the button never respects the order and never returning the same order.

It's all-time random :

0693p00000BWs2HAAT.png

0693p00000BWs39AAD.png

 

Any Help ?

Thank you

Labels (3)
10 Replies
ozhelezniak
Contributor
Contributor

Hello @safouane BEN MANSOUR​ 

 

Is it your component? Could you share a source code of the method either that builds the schema for your @DiscoverSchema method or the whole @DisoverSchema method?

It might be something non-deterministic in the implementation of @DiscoverSchema method.

 

Best regards, Oleksandr

undx
Creator
Creator

Hi @safouane BEN MANSOUR​ ,

Which Studio's release / Patches applied are you using?

 

This is a known issue that has been fixed in component-runtime 1.1.24 release. The relevant patch applies from R2020-08 monthly patch.

 

Safus
Creator
Creator
Author

Hello @Oleksandr Zhelezniak​ , yes it's one of my test components.

The source code :

 

@Service

public class DemoComponentsService {

 

 

@DiscoverSchema(value = "CustomDataset")

public Schema discoverSchema(

@Option CustomDataset dataset,

final RecordBuilderFactory recordBuilderFactory) {

 

 

Schema.Builder schemaBuilder = recordBuilderFactory.newSchemaBuilder(

Schema.Type.RECORD);

 

Schema.Entry.Builder entryBuilder =

recordBuilderFactory.newEntryBuilder();

 

schemaBuilder.withEntry(

setSchemaEntry("col1", Schema.Type.STRING, entryBuilder));

schemaBuilder.withEntry(

setSchemaEntry("col2", Schema.Type.STRING, entryBuilder));

schemaBuilder.withEntry(

setSchemaEntry("col3", Schema.Type.STRING, entryBuilder));

schemaBuilder.withEntry(

setSchemaEntry("col4", Schema.Type.STRING, entryBuilder));

 

return schemaBuilder.build();

}

 

private Schema.Entry setSchemaEntry(

String fieldName, Schema.Type type, Schema.Entry.Builder entryBuilder) {

 

return entryBuilder.withName(

fieldName

).withType(

type

).withNullable(

false

).withComment(

"Comment text here"

).build();

}

 

}

 

Best regards

 

Safus
Creator
Creator
Author

Hi @Emmanuel GALLOIS​ :

 

Talend Cloud Big Data

 

Version: 7.3.1

Build id: 20200219_1130

 

with :

 

<dependency>

<groupId>org.talend.sdk.component</groupId>

<artifactId>component-api</artifactId>

<version>1.29.1</version>

<scope>provided</scope>

</dependency>

 

undx
Creator
Creator

I think that you've developed your component with a recent framework version but there's an integration part in Studio that may differs from your component-runtime version (1.29.1 is planned for R2021-02).

From what you mentioned, Your Studio seems to be unpatched. It should be patched to at least 7.3 R2020-08 monthly patch for a correct order in your guess schema action. (FYI: integration part may be not at same level)

Safus
Creator
Creator
Author

So if it's impossible at the moment to download and apply a patch can a downgrade of the component-runtime fix the issue ?

undx
Creator
Creator

No downgrading the component-runtime version won't fix the issue as the fix is in sdk integration part.

The only solution to have a correct order in schema returned is to used a patched version of plugins/org.talend.sdk.component.studio-integration_7.X.jar coming with monthly patches (or on master aka 7.4.1)

ozhelezniak
Contributor
Contributor

Okay, my guess about non-determinisitc schema build was wrong.

Please proceed with suggestions from undx.

Update your Studio with a monthly patch.

 

Best regards

Safus
Creator
Creator
Author

I just downloaded the 7.4.1 TOS Beta version.

 

Same source code, I just deployed the component to my new talend folder and nothing works.

 

java.lang.reflect.InvocationTargetException

   at org.talend.sdk.component.studio.ui.guessschema.GuessSchemaRunnable.run(GuessSchemaRunnable.java:52)

   at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/path/TOS_DI-20210107_1111-V7.4.1M6/configuration/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.12.1/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/path/TOS_DI-20210107_1111-V7.4.1M6/configuration/.m2/repository/org/talend/sdk/component/slf4j-standard/1.29.0-SNAPSHOT/slf4j-standard-1.29.0-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class]