Schema Different from Query

Highlighted
One Star

Schema Different from Query

Sirs,
I have the simple need to translate some columns from a table with 7 columns to a table with 3 columns using the rule below...
SELECT CONCAT(DATE(date),' ',HOUR(date),':00:00'),
COUNT(transaction),
operstatus_ID
FROM transactiontable
GROUP BY DATE(date), HOUR(date), operstatus_ID
ORDER BY DATE(date), HOUR(date), operstatus_ID
But I couldn`t do it with success until now... Putting this query in the properties of the component tMySQLInput, I receive that: schema is different from query. The 'Guess Schema' button doesn`t work.
Someone can help me in the creation of my schema?
Lot of thanks.
Highlighted
Community Manager

Re: Schema Different from Query

Hello
chema is different from query.

You query more or less coulmns than columns defined on schema, eg you query 4 fields, but there are only 3 fields on schema.
The 'Guess Schema' button doesn`t work.

The 'guess schema' works with a standard query. for example:
"select person.id, person.name from person"
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
One Star

Re: Schema Different from Query

Thank you Shong!
But... and how I should made this work? Which components? Which procedure?
Highlighted
Community Manager

Re: Schema Different from Query

Hello
In you case, you need define three columns.
date
count
operstatus_ID
please see my screenshot.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog