Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now

Reply
dineshkumarravi
Frequent Visitor

Copy Activity - Hash key generation and datatype issue using snowflake connector.

Hi Good morning Am using Copy activity copy the data from snowflake to lakehouse.
 
Snowflake structure
 
create or replace TABLE DB.TABLES.PRODUCT (
PRODUCTID VARCHAR(50),
PRODUCTNAME VARCHAR(100),
CATEGORY VARCHAR(50),
PRICE VARCHAR(50),
STOCKQUANTITY VARCHAR(50),
SUPPLIERID VARCHAR(50),
INSERTEDDATETIME VARCHAR(50),
UPDATEDDATETIME VARCHAR(50),
ISCURRENT BOOLEAN,
LOADDATETIME VARCHAR(50),
AD_INSERTDATETIME VARCHAR(50)
);
 
Lakehouse table sturucture
 
schema = StructType([
    StructField("PRODUCTID", StringType(), True),
    StructField("PRODUCTNAME", StringType(), True),
    StructField("CATEGORY", StringType(), True),
    StructField("PRICE", StringType(), True),
    StructField("STOCKQUANTITY", StringType(), True),
    StructField("SUPPLIERID", StringType(), True),
    StructField("INSERTEDDATETIME", StringType(), True),
    StructField("UPDATEDDATETIME", StringType(), True),
    StructField("ISCURRENT", StringType(), True),
StructField("HASHKEY", StringType(), True),
StructField("AD_INSERTDATETIME", StringType(), True),
])
 
Question 1
1. i create new table in in lakehouse using pyspark,only schema datatype StringType(), copy the data from snowflake to lakehouse,if i change the datatype empty dataset rows copied to lakehouse.is there anything have to do ?
 
Question 2
 
2. I need to create a new hashkey 
{
  "type": "TabularTranslator",
  "mappings": [
    {
      "source": { "name": "AD_INSERTDATETIME" },
      "sink": { "name": "AD_INSERTDATETIME" }
    },
    {
      "source": { "name": "ISCURRENT" },
      "sink": { "name": "ISCURRENT" }
    },
    {
      "source": { "name": "UPDATEDDATETIME" },
      "sink": { "name": "UPDATEDDATETIME" }
    },
    {
      "source": { "name": "INSERTEDDATETIME" },
      "sink": { "name": "INSERTEDDATETIME" }
    },
    {
      "source": { "name": "SUPPLIERID" },
      "sink": { "name": "SUPPLIERID" }
    },
    {
      "source": { "name": "STOCKQUANTITY" },
      "sink": { "name": "STOCKQUANTITY" }
    },
    {
      "source": { "name": "PRICE" },
      "sink": { "name": "PRICE" }
    },
    {
      "source": { "name": "CATEGORY" },
      "sink": { "name": "CATEGORY" }
    },
    {
      "source": { "name": "PRODUCTNAME" },
      "sink": { "name": "PRODUCTNAME" }
    },
    {
      "source": { "name": "PRODUCTID" },
      "sink": { "name": "PRODUCTID" }
    },
    {
      "source": { "name": "LOADDATETIME" },
      "sink": { "name": "LOADDATETIME" }
    },
    {
      "source": {
        "name": "HASHKEY",
        "expression": "HASH(CONCAT(PRODUCTID, PRODUCTNAME))"
      },
      "sink": {
        "name": "HASHKEY"
      }
    }
  ]
}
 
but its not work for me. if anything miss kindly let me know fix the above 2 isssues ?

 

1 REPLY 1
v-nuoc-msft
Community Support
Community Support

Hi @dineshkumarravi 

 

Thank you for your question. You can go to the following link to ask your question. There are more professional engineers there to help you solve the problem:

 

Get Help with Data Warehouse - Microsoft Fabric Community

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebFBC_Carousel

Fabric Monthly Update - February 2025

Check out the February 2025 Fabric update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.