blob: 3a9c837a731c20aa45c362ef85e6169c22e5431e [file] [log] [blame]
{"version":3,"sources":["/home/madhan/Apache/git/atlas/docs/target/src/documents/Import-Export/ImportEntityTransforms.md","/home/madhan/Apache/git/atlas/docs/target/theme/styles/styled-colors.js"],"names":["layoutProps","MDXContent","components","props","mdxType","parentName","wrapLines","language","style","theme","isMDXComponent","dark","hljs","color"],"mappings":"+lBAWMA,EAAc,GAIL,SAASC,EAAW,GAG/B,IAFFC,EAAU,EAAVA,WACGC,EAAK,iBAER,OAAO,cALS,UAKC,iBAAKH,EAAiBG,EAAK,CAAED,WAAYA,EAAYE,QAAQ,cAE5E,oBACE,GAAM,mCAAiC,qCAEzC,oBACE,GAAM,cAAY,cAEpB,mTACA,oBACE,GAAM,4BAA0B,4BAElC,kJACA,mEACA,wBACE,oBAAIC,WAAW,MAAI,yFACnB,oBAAIA,WAAW,MAAI,gEAErB,yFACA,oBACE,GAAM,2CAAyC,2CAEjD,kgBAEA,oBACE,GAAM,YAAU,YAElB,6GACA,wBACE,oBAAIA,WAAW,MAAI,2BACnB,oBAAIA,WAAW,MAAI,8DAErB,oBACE,GAAM,cAAY,cAEpB,6DACA,2BACE,uBAAOA,WAAW,SAChB,oBAAIA,WAAW,SACb,oBAAIA,WAAW,KACb,MAAS,MACR,wBAAQA,WAAW,MAAI,oBAC1B,oBAAIA,WAAW,KACb,MAAS,MACR,wBAAQA,WAAW,MAAI,kBAG9B,uBAAOA,WAAW,SAChB,oBAAIA,WAAW,SACb,oBAAIA,WAAW,KACb,MAAS,MAAI,cAEf,oBAAIA,WAAW,KACb,MAAS,MAAI,qBAGjB,oBAAIA,WAAW,SACb,oBAAIA,WAAW,KACb,MAAS,MAAI,oBAEf,oBAAIA,WAAW,KACb,MAAS,MAAI,qFAC0E,oBAAIA,WAAW,MAAI,sBAA4B,MAE1I,oBAAIA,WAAW,SACb,oBAAIA,WAAW,KACb,MAAS,MAAI,UAEf,oBAAIA,WAAW,KACb,MAAS,MAAI,mEAGjB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5M,cAAC,IAAiB,CAACC,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYL,QAAQ,qBAAmB,qKAUlG,wKACA,cAAC,IAAiB,CAACE,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYL,QAAQ,qBAAmB,8IAUlG,kJACA,cAAC,IAAiB,CAACE,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYL,QAAQ,qBAAmB,uJAUlG,oBACE,GAAM,kBAAgB,kBAExB,iMACA,wDAAqC,oBAAIC,WAAW,KAAG,WAAiB,iCAAkC,oBAAIA,WAAW,KAAG,WAAiB,KAC7I,cAAC,IAAiB,CAACC,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYL,QAAQ,qBAAmB,6KAUlG,oBACE,GAAM,YAAU,YAElB,yHACA,cAAC,IAAiB,CAACE,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYL,QAAQ,qBAAmB,oJAUlG,oBACE,GAAM,SAAO,SAEf,2CAAwB,oBAAIC,WAAW,KAAG,8DAAoE,6BAC9G,cAAC,IAAiB,CAACC,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYL,QAAQ,qBAAmB,wJAUlG,oBACE,GAAM,uBAAqB,uBAE7B,yCAAsB,mBAAGC,WAAW,IAChC,KAAQ,kIAAgI,eACpH,sCAE3B,2MAEDJ,EAAWS,gBAAiB,G,+DCjR5B,iFAqBAC,IAAKC,KAAKC,MAAQ,UACHF,MAAI","file":"static/js/documents-import-export-import-entity-transforms.952a218e.js","sourcesContent":["\nimport React from 'react'\nimport { mdx } from '@mdx-js/react'\n\n/* @jsxRuntime classic */\n/* @jsx mdx */\nimport themen from 'theme/styles/styled-colors';\nimport * as theme from 'react-syntax-highlighter/dist/esm/styles/hljs';\nimport SyntaxHighlighter from 'react-syntax-highlighter';\n\n\nconst layoutProps = {\n \n};\nconst MDXLayout = \"wrapper\"\nexport default function MDXContent({\n components,\n ...props\n}) {\n return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n\n <h1 {...{\n \"id\": \"new-entity-transforms-framework\"\n }}>{`(New) Entity Transforms Framework`}</h1>\n <h4 {...{\n \"id\": \"background\"\n }}>{`Background`}</h4>\n <p>{`During Import Process, entity transforms are required to make changes to the entity before it gets committed to the database. These modifications are necessary to make the entity conform to the environment it is going to reside. The Import Process provided a mechanism to do that.`}</p>\n <h4 {...{\n \"id\": \"transformation-framework\"\n }}>{`Transformation Framework`}</h4>\n <p>{`A transformation framework allows a mechanism to selectively transform an entity or specific attributes of that entity.`}</p>\n <p>{`To achieve this, the framework provides:`}</p>\n <ul>\n <li parentName=\"ul\">{`Way to set a condition that needs to be satisfied for a transformation to be applied.`}</li>\n <li parentName=\"ul\">{`Action to be taken on the entity once the condition is met.`}</li>\n </ul>\n <p>{`The existing transformation frameworks allowed this to happen.`}</p>\n <h4 {...{\n \"id\": \"reason-for-new-transformation-framework\"\n }}>{`Reason for New Transformation Framework`}</h4>\n <p>{`While the existing framework provided the basic benefits of the transformation framework, it did not have support for some commonly used Atlas types. Which meant that users of this framework would have to meticulously define transformations for every type they are working with. This can be tedious and potentially error-prone.\nThe new framework addresses this problem by providing built-in transformations for some commonly used types. It can also be extended to accommodate new types.`}</p>\n <h4 {...{\n \"id\": \"approach\"\n }}>{`Approach`}</h4>\n <p>{`The approach used by the new transformation framework creates a transformation by:`}</p>\n <ul>\n <li parentName=\"ul\">{`Specifying a condition.`}</li>\n <li parentName=\"ul\">{`Specifying action(s) to be taken if the condition is met.`}</li>\n </ul>\n <h5 {...{\n \"id\": \"conditions\"\n }}>{`Conditions`}</h5>\n <p>{`Following are built-in conditions.`}</p>\n <table>\n <thead parentName=\"table\">\n <tr parentName=\"thead\">\n <th parentName=\"tr\" {...{\n \"align\": null\n }}><strong parentName=\"th\">{`Condition Types`}</strong></th>\n <th parentName=\"tr\" {...{\n \"align\": null\n }}><strong parentName=\"th\">{`Description`}</strong></th>\n </tr>\n </thead>\n <tbody parentName=\"table\">\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`ENTITY_ALL`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Any/every entity`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`ENTITY_TOP_LEVEL`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Entity that is the top-level entity. This is also the entity present specified in `}<em parentName=\"td\">{`AtlasExportRequest`}</em>{`.`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`EQUALS`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Entity attribute equals to the one specified in the condition.`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`EQUALS_IGNORE_CASE`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Entity attribute equals to the one specified in the condition ignoring case.`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`STARTS_WITH`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Entity attribute starts with.`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`STARTS_WITH_IGNORE_CASE`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Entity attribute starts with ignoring case.`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`HAS_VALUE`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Entity attribute has value.`}</td>\n </tr>\n </tbody>\n </table>\n <h5 {...{\n \"id\": \"actions\"\n }}>{`Actions`}</h5>\n <table>\n <thead parentName=\"table\">\n <tr parentName=\"thead\">\n <th parentName=\"tr\" {...{\n \"align\": null\n }}><strong parentName=\"th\">{`Action Type`}</strong></th>\n <th parentName=\"tr\" {...{\n \"align\": null\n }}>{`*Description**`}</th>\n </tr>\n </thead>\n <tbody parentName=\"table\">\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`ADD_CLASSIFICATION`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Add classification`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`REPLACE_PREFIX`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Replace value starting with another value.`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`TO_LOWER`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Convert a value of an attribute to lower case.`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`SET`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Set the value of an attribute`}</td>\n </tr>\n <tr parentName=\"tbody\">\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`CLEAR`}</td>\n <td parentName=\"tr\" {...{\n \"align\": null\n }}>{`Clear value of an attribute`}</td>\n </tr>\n </tbody>\n </table>\n <h4 {...{\n \"id\": \"built-in-transforms\"\n }}>{`Built-in Transforms`}</h4>\n <h5 {...{\n \"id\": \"add-classification\"\n }}>{`Add Classification`}</h5>\n <p>{`During import, hive`}<em parentName=\"p\">{`db entity whose _qualifiedName`}</em>{` is `}<em parentName=\"p\">{`stocks@cl1`}</em>{` will get the classification `}<em parentName=\"p\">{`clSrcImported`}</em>{`.`}</p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`{\n \"conditions\": {\n \"hive_db.qualifiedName\": \"stocks@cl1\"\n },\n \"action\": {\n \"__entity\": \"ADD_CLASSIFICATION: clSrcImported\"\n }\n}`}\n </SyntaxHighlighter>\n <p>{`Every imported entity will get the classification by simply changing the condition. The __entity is a special condition which matches entity.`}</p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`{\n \"conditions\": {\n \"__entity\": \"\"\n },\n \"action\": {\n \"__entity\": \"ADD_CLASSIFICATION: clSrcImported\"\n }\n}`}\n </SyntaxHighlighter>\n <p>{`To add the classification to only the top-level entity (an entity that is used as a starting point for an export), use:`}</p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`{\n \"conditions\": {\n \"__entity\": \"topLevel:\"\n },\n \"action\": {\n \"__entity\": \"ADD_CLASSIFICATION: clSrcImported\"\n }\n}`}\n </SyntaxHighlighter>\n <h5 {...{\n \"id\": \"replace-prefix\"\n }}>{`Replace Prefix`}</h5>\n <p>{`This action works on string values. The first parameter is the prefix that is searched for a match, once matched, it is replaced with the provided replacement string.`}</p>\n <p>{`The sample below searches for `}<em parentName=\"p\">{`/aa/bb/`}</em>{`, once found replaces it with `}<em parentName=\"p\">{`/xx/yy/`}</em>{`.`}</p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`{\n \"conditions\": {\n \"hdfs_path.clusterName\": \"EQUALS: CL1\"\n },\n \"action\": {\n \"hdfs_path.path\": \"REPLACE_PREFIX: = :/aa/bb/=/xx/yy/\"\n }\n}`}\n </SyntaxHighlighter>\n <h5 {...{\n \"id\": \"to-lower\"\n }}>{`To Lower`}</h5>\n <p>{`Entity whose hdfs_path.clusterName is CL1 will get its path attribute converted to lower case.`}</p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`{\n \"conditions\": {\n \"hdfs_path.clusterName\": \"EQUALS: CL1\"\n },\n \"action\": {\n \"hdfs_path.path\": \"TO_LOWER:\"\n }\n}`}\n </SyntaxHighlighter>\n <h5 {...{\n \"id\": \"clear\"\n }}>{`Clear`}</h5>\n <p>{`Entity whose hdfs`}<em parentName=\"p\">{`path.clusterName has value set, will get its _replicatedTo`}</em>{` attribute value cleared.`}</p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`{\n \"conditions\": {\n \"hdfs_path.clusterName\": \"HAS_VALUE:\"\n },\n \"action\": {\n \"hdfs_path.replicatedTo\": \"CLEAR:\"\n }\n}`}\n </SyntaxHighlighter>\n <h4 {...{\n \"id\": \"additional-examples\"\n }}>{`Additional Examples`}</h4>\n <p>{`Please look at `}<a parentName=\"p\" {...{\n \"href\": \"https://github.com/apache/atlas/blob/master/intg/src/test/java/org/apache/atlas/entitytransform/TransformationHandlerTest.java\"\n }}>{`these tests`}</a>{` for examples using Java classes.`}</p>\n </MDXLayout>;\n}\n;\nMDXContent.isMDXComponent = true;","/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { dark } from \"react-syntax-highlighter/dist/esm/styles/hljs\";\n\n//dark[\"powershell\"][\"color\"] = \"#37bb9b\";\ndark.hljs.color = \"#37bb9b\";\nexport default dark;"],"sourceRoot":""}