Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-574

[Service] Avro schema is not deserialized from payload

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • None
    • None
    • None
    • Hide

      Pass following PropertiesDto to PropertiesHelpers.propertiesFromDto() method

      {
      	"dependencies": [{
      			"dbTypes": "Hive",
      			"jdbcUrl": "",
      			"userId": "",
      			"password": "",
      			"@definitionName": "JDBCDatastore"
      		}
      	],
      	"properties": {
      		"sourceType": "QUERY",
      		"datastore": "JDBCDatastore",
      		"@definitionName": "JDBCDataset",
      		"main": {
      			"schema": {
      				"type": "record",
      				"name": "DYNAMIC",
      				"fields": [{
      						"name": "id",
      						"type": "string",
      						"talend.field.precision": 11,
      						"talend.field.dbType": 4,
      						"talend.field.dbColumnName": "id"
      					}, {
      						"name": "name",
      						"type": "string",
      						"talend.field.length": 30,
      						"talend.field.dbType": 12,
      						"talend.field.dbColumnName": "name"
      					}
      				]
      			}
      
      		},
      		"sql": "select * from testkmo_createhivetable limit 10"
      	}
      }
      

      Expected:
      Dataset Properties instance, which contains non-empty schema
      main.schema.storedValue

      Actual:
      schema is empty

      Show
      Pass following PropertiesDto to PropertiesHelpers.propertiesFromDto() method { "dependencies" : [{ "dbTypes" : "Hive" , "jdbcUrl" : "", "userId" : "", "password" : "", "@definitionName" : "JDBCDatastore" } ], "properties" : { "sourceType" : "QUERY" , "datastore" : "JDBCDatastore" , "@definitionName" : "JDBCDataset" , "main" : { "schema" : { "type" : "record" , "name" : "DYNAMIC" , "fields" : [{ "name" : "id" , "type" : "string" , "talend.field.precision" : 11, "talend.field.dbType" : 4, "talend.field.dbColumnName" : "id" }, { "name" : "name" , "type" : "string" , "talend.field.length" : 30, "talend.field.dbType" : 12, "talend.field.dbColumnName" : "name" } ] } }, "sql" : "select * from testkmo_createhivetable limit 10" } } Expected: Dataset Properties instance, which contains non-empty schema main.schema.storedValue Actual: schema is empty
    • All
    • Hide

      no more relevant

      Show
      no more relevant
    • Small

    Description

      PropertiesHelpers.propertiesFromDto() doesn't deserialize dataset properties correctly
      https://github.com/Talend/components/blob/master/services/components-api-service-rest/src/main/java/org/talend/components/service/rest/impl/PropertiesHelpers.java#L48

      Avro schema is not set. It remains EMPTY_SCHEMA.

      Attachments

        Activity

          People

            igonchar Ivan Gonchar
            igonchar Ivan Gonchar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: