locked
How to initialize TabularTranslator Mapping in .NET/C# RRS feed

  • Question

  • Hi, 

    I am trying to create a dynamic ADF pipeline between JSON source and a Azure SQL Database. I am also trying to achieve the dynamic column mapping between these and need to use TabularTranslator mapping. Can you help me know how to initialize the Mappings in C#?

    Translator = new TabularTranslator
                            {

                                //Mappings = ??
                            }
               

    Thanks

     

    Jay Akhawri


    • Edited by Jay.Akhawri Wednesday, April 29, 2020 8:21 AM
    Wednesday, April 29, 2020 8:21 AM

Answers

  • Thanks, but that is not really what I was looking for.  However, I was able to find the way. For those who may need to know, looks like you can chose SchemaMapping type and map it to a Dictionary object. Worked well for me!


      

    Jay Akhawri

    • Marked as answer by Jay.Akhawri Wednesday, April 29, 2020 5:55 PM
    Wednesday, April 29, 2020 5:55 PM

All replies

  • Here you go:

    https://docs.microsoft.com/en-us/azure/data-factory/copy-activity-schema-and-type-mapping

    You can also use ordinals instead of names like:

    "mappings": [
                    {
                        "source": {
                            "path": "['Name']"
                        },
                        "sink": {
                            "type": "String",
                            "ordinal": 1
                        }
                    },
                    {
                        "source": {
                            "path": "['ID']"
                        },
                        "sink": {
                            "type": "String",
                            "ordinal": 2
                        }
                    }
    ]
    

    Wednesday, April 29, 2020 2:40 PM
  • Thanks, but that is not really what I was looking for.  However, I was able to find the way. For those who may need to know, looks like you can chose SchemaMapping type and map it to a Dictionary object. Worked well for me!


      

    Jay Akhawri

    • Marked as answer by Jay.Akhawri Wednesday, April 29, 2020 5:55 PM
    Wednesday, April 29, 2020 5:55 PM