title: Failure loading parquet in Synapse Analytics - INT mapped as UTF8
body: <p>We have an on-premise Oracle database from which we need to extract data and store this in a Synapse dedicated pool. I have created a Synapse pipeline which first copies the data from Oracle to a datalake in a parquet file, which should then be imported into Synapse using a second copy task.
  The data from Oracle is extracted through a dynamically created query. This query has 2 hard-coded INT values which are generated at runtime. The query runs fine and the parquet file is created correctly, but if I use polybase or copy command to import the file to Synapse it fails with the following error:</p>
  <blockquote>
  <p>&quot;errorCode&quot;: &quot;2200&quot;,
  &quot;message&quot;: &quot;ErrorCode=UserErrorSqlDWCopyCommandError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=SQL DW Copy Command operation failed with error 'HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: ClassCastException: ',Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: ClassCastException: ,Source=.Net SqlClient Data Provider,SqlErrorNumber=106000,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=106000,State=1,Message=HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: ClassCastException: ,},],'&quot;,</p>
  </blockquote>
  <p>Bulk insert works but is less efficient on large quantities of data so I don't want to use that.
  The mapping for the copy activities is created dynamically based on the target database table definition. However, when I created a separate copy task and import the mapping to check what is going on, I noticed that the 2 INT columns are mapped as UTF8 on the parquet source side. The sink table is INT32. When I exclude both columns the copy task completes successfully. It seems that the copy activity fails because it cannot implicitly cast a string to an integer.</p>
  <p><a href="https://i.stack.imgur.com/PwNtf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PwNtf.png" alt="enter image description here" /></a></p>
  <p>The 2 columns are explicitly cast as integers in the Oracle query that is the source for the parquet file.</p>
  <pre><code>SELECT  t.* 
      ,   CAST(419 AS INT) AS &quot;Execution_id&quot;
      ,   CAST(4832 AS INT) AS &quot;Task_id&quot;
      ,   TO_DATE('2022-07-05 14:40:34', 'YYYY-MM-DD HH24:MI:SS') AS &quot;ProcessedDTS&quot;
      ,   t.DEMUTDT AS &quot;EffectiveDTS&quot; 
  FROM    CBO.DRKASTR t
  WHERE   DEMUTDT &gt;= TO_DATE('2022-07-05 13:37:35', 'YYYY-MM-DD HH24:MI:SS');
  </code></pre>
  <p>Adding an explicit mapping for Oracle to parquet mapping them as INT also doesn't solve the problem.
  How do I prevent these 2 columns from being interpreted as integers instead of strings?!</p>