<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: cannot resolve '(CAST(10000 AS BIGINT) div Khe)' due to data type mismatch: in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22963#M15815</link>
    <description>&lt;P&gt;@Adalberto Garcia Espinosa​&amp;nbsp;, Have you tried doubles only?&lt;/P&gt;&lt;P&gt;Fctor_HL_Estiba double GENERATED ALWAYS AS (cast(10000 as double) div Khe),&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 19:01:09 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2022-04-13T19:01:09Z</dc:date>
    <item>
      <title>cannot resolve '(CAST(10000 AS BIGINT) div Khe)' due to data type mismatch:</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22962#M15814</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to create a delta table using SQL but I'm getting this error&lt;/P&gt;&lt;P&gt;Error in SQL statement: AnalysisException: cannot resolve '(CAST(10000 AS BIGINT) div Khe)' due to data type mismatch: differing types in '(CAST(10000 AS BIGINT) div Khe)' (bigint and double).; line 1 pos 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried different combinations but still the same error. Anyone knows how to fix it. Here is the whole create statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OR REPLACE TABLE Productos(&lt;/P&gt;&lt;P&gt;	Cdgo_Prdcto varchar(10) NOT NULL,&lt;/P&gt;&lt;P&gt;	Dscrpcion varchar(100) NOT NULL,&lt;/P&gt;&lt;P&gt;	Cdgo_Unico varchar(10) NOT NULL,&lt;/P&gt;&lt;P&gt;	Vlmen float,&lt;/P&gt;&lt;P&gt;	Volumen_Undad varchar(10),&lt;/P&gt;&lt;P&gt;	Cpcdad varchar(10),&lt;/P&gt;&lt;P&gt;	Khe double NOT NULL,&lt;/P&gt;&lt;P&gt;	Cdgo_Ctgria varchar(5) NOT NULL,&lt;/P&gt;&lt;P&gt;	Cdgo_Mrca varchar(5) NOT NULL,&lt;/P&gt;&lt;P&gt;	Cdgo_Tpo_Envse varchar(5) NOT NULL,&lt;/P&gt;&lt;P&gt;	Cdgo_Msto int,&lt;/P&gt;&lt;P&gt;	Cdgo_Orgen_Rem varchar(10),&lt;/P&gt;&lt;P&gt;	Cdgo_Cja varchar(10),&lt;/P&gt;&lt;P&gt;	Cdgo_Estba varchar(10),&lt;/P&gt;&lt;P&gt;	Cdgo_Envse varchar(10),&lt;/P&gt;&lt;P&gt;	Grpo_Ssttcion int,&lt;/P&gt;&lt;P&gt;	EsPdreSsttcion boolean,&lt;/P&gt;&lt;P&gt;	Cdgo_Envsdo varchar(10),&lt;/P&gt;&lt;P&gt;	Cdgo_Trspaso varchar(10),&lt;/P&gt;&lt;P&gt;	Es_Rmpque boolean NOT NULL,&lt;/P&gt;&lt;P&gt;	Es_Exprtcion boolean NOT NULL,&lt;/P&gt;&lt;P&gt;	Unddes_Cja int NOT NULL,&lt;/P&gt;&lt;P&gt;	Fctor_Estbas int NOT NULL,&lt;/P&gt;&lt;P&gt;	Unidad_Venta int NOT NULL,&lt;/P&gt;&lt;P&gt;	Unidad_Medida_Venta varchar(10) NOT NULL,&lt;/P&gt;&lt;P&gt;	Csto_Estndar float,&lt;/P&gt;&lt;P&gt;	Vgncia boolean NOT NULL,&lt;/P&gt;&lt;P&gt;	Vgncia_Plncion boolean NOT NULL,&lt;/P&gt;&lt;P&gt;	Vgncia_Plncion_Dria boolean NOT NULL,&lt;/P&gt;&lt;P&gt;	Vgncia_Plncion_MPS boolean NOT NULL,&lt;/P&gt;&lt;P&gt;	EnCrcion boolean,&lt;/P&gt;&lt;P&gt;	COD_PRO varchar(10),&lt;/P&gt;&lt;P&gt;	COD_TEN varchar(10),&lt;/P&gt;&lt;P&gt;	COD_TEN_REM varchar(10),&lt;/P&gt;&lt;P&gt;	Peso_g float,&lt;/P&gt;&lt;P&gt;	Ocpcion float,&lt;/P&gt;&lt;P&gt;	Fctor_HL_Estiba double GENERATED ALWAYS AS (cast(10000 as bigint) div Khe),&lt;/P&gt;&lt;P&gt;	Fctor_HL_UND float GENERATED ALWAYS&amp;nbsp;AS (10000 * khe) ,&lt;/P&gt;&lt;P&gt;	Fctor_HL_Cajas bigint GENERATED ALWAYS AS (cast(10000 as float) div (cast(khe as float) div unddes_cja)),&lt;/P&gt;&lt;P&gt;	Temp_Vngcia_TMS boolean ,&lt;/P&gt;&lt;P&gt;	Vol_Id int ,&lt;/P&gt;&lt;P&gt;	Prsntcion_Id int ,&lt;/P&gt;&lt;P&gt;	Prcio_Vnta float ,&lt;/P&gt;&lt;P&gt;	Cdgo_Dmnda varchar(10) ,&lt;/P&gt;&lt;P&gt;	Es_Promo boolean ,&lt;/P&gt;&lt;P&gt;	Mrgen_Gncia float ,&lt;/P&gt;&lt;P&gt;	Csto_Estndar_Pryctdo float ,&lt;/P&gt;&lt;P&gt;	Excise_HL float ,&lt;/P&gt;&lt;P&gt;	Jrrquia varchar(20) ,&lt;/P&gt;&lt;P&gt;	Es_Cmbo boolean ,&lt;/P&gt;&lt;P&gt;	Es_NPD boolean ,&lt;/P&gt;&lt;P&gt;	FechaInicio_NPD timestamp ,&lt;/P&gt;&lt;P&gt;	FechaFin_NPD timestamp ,&lt;/P&gt;&lt;P&gt;	Cdgo_Capacidad varchar(10) ,&lt;/P&gt;&lt;P&gt;	Usrio_Retro_Invntrios varchar(50) ,&lt;/P&gt;&lt;P&gt;	Arrume float ,&lt;/P&gt;&lt;P&gt;	Cjas_por_Nvel int ,&lt;/P&gt;&lt;P&gt;	Nvel_Prmtdo int ,&lt;/P&gt;&lt;P&gt;	Arrume_Estanteria float ,&lt;/P&gt;&lt;P&gt;	APILADO varchar(10) ,&lt;/P&gt;&lt;P&gt;	PesoNeto_g float&amp;nbsp;&lt;/P&gt;&lt;P&gt;	)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 15:30:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22962#M15814</guid>
      <dc:creator>Adalberto</dc:creator>
      <dc:date>2022-04-13T15:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: cannot resolve '(CAST(10000 AS BIGINT) div Khe)' due to data type mismatch:</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22963#M15815</link>
      <description>&lt;P&gt;@Adalberto Garcia Espinosa​&amp;nbsp;, Have you tried doubles only?&lt;/P&gt;&lt;P&gt;Fctor_HL_Estiba double GENERATED ALWAYS AS (cast(10000 as double) div Khe),&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 19:01:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22963#M15815</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-13T19:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: cannot resolve '(CAST(10000 AS BIGINT) div Khe)' due to data type mismatch:</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22964#M15816</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp;, Yes. Same error &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 23:48:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22964#M15816</guid>
      <dc:creator>Adalberto</dc:creator>
      <dc:date>2022-04-13T23:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: cannot resolve '(CAST(10000 AS BIGINT) div Khe)' due to data type mismatch:</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22965#M15817</link>
      <description>&lt;P&gt;Hi @Adalberto Garcia Espinosa​ Do you need khe column to be double? If not, below query is working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql CREATE OR REPLACE TABLE Productos(Khe bigint NOT NULL,Fctor_HL_Estiba bigint GENERATED ALWAYS AS (cast(10000 as bigint) div Khe)) seems to be working. &lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 15:52:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22965#M15817</guid>
      <dc:creator>Noopur_Nigam</dc:creator>
      <dc:date>2022-05-13T15:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: cannot resolve '(CAST(10000 AS BIGINT) div Khe)' due to data type mismatch:</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22966#M15818</link>
      <description>&lt;P&gt;Hi @Adalberto Garcia Espinosa​,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a friendly follow-up. Did Noopur's response help you to resolve your issue? Please let us know.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 18:31:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-resolve-cast-10000-as-bigint-div-khe-due-to-data-type/m-p/22966#M15818</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2022-06-07T18:31:34Z</dc:date>
    </item>
  </channel>
</rss>

