3 Star 0 Fork 0

mirrors_microsoft/adb2spark

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Guidance for migrating from Azure Databricks to Synapse Spark Analytics

This repo contains guidance including code samples to document challenges one might face while migrating from Azure Databricks to Synapse Spark and solutions to these challenges.

Issue Reason Solution Related files
HttpException TBF TBF TBF
Tables which needs graphframes library (no PK, UK tables) are giving error Graphframes jar used by ADB is not the public version of library and thus differs from one used in Spark Setup correct Graphframes jar Code sample - Graphframes
Date Format Issue Occurs when statistics are collected for the date column during checkpointing. These statistics are not used for filter file-pruning and thus can be safely switched off without impacting performance Add spark configuration to turn off stats collection for delta Code sample - Date Format
SQL Paas connection error TBF TBF TBF

Code sample - Date Format

spark.conf.set("spark.microsoft.delta.stats.collect", "false") # turning off statistics
tableExample = DeltaTable.forPath(spark, centralized_table_path)
tableExample.recomputeStatistics() # removing existing statistics, needed to execute only once

Code sample - Graphframes

How to setup graphframes:

  1. Generated a whl file to add to the workspace following steps to generate the whl file.
  2. Upload the generated whl file and the jar for same version to the spark pool.
  3. Test the installation of graphframes by executing example from official docs.

Steps to generate whl file: Several resources available for generating whl file like the one below:

  1. Download required zip version from here. Unzip setup.py available in path graphrames-zip-folder/python/setup.py
  2. Modify the setup.py to have some basic info, sample setup.py at the end of the doc.
  3. Install wheel: pip install wheel setuptools
  4. Build whl file: python path/to/setup.py bdist_wheel. Whl file would be generated in the graphrames-zip-folder/python/dist/
  5. Test that package is installed using whl file locally: python3 -m pip install dist/graphframes-0.8.2-py3-none-any.whl

Sample setup.py:

"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import pathlib

VERSION = '0.0.1'
DESCRIPTION = 'My first Python package'
LONG_DESCRITPTION = 'My first Python package with a slightly longer description'

setup(

    # There are some restrictions on what makes a valid project name
    # specification here:
    # https://packaging.python.org/specifications/core-metadata/#name
    name='graphframes',  # Required

    version='0.8.2',  # Required

    description='A sample Python project',  # Optional

    author='Author Name',  # Optional

    package_dir={'': 'graphframes'},  # Optional

    packages=find_packages(where='graphframes'),  # Required

    python_requires='>=3.6, <4',
    project_urls={  # Optional
        'Bug Reports': 'https://github.com/pypa/sampleproject/issues',
        'Funding': 'https://donate.pypi.org',
        'Say Thanks!': 'http://saythanks.io/to/example',
        'Source': 'https://github.com/pypa/sampleproject/',
    },
)

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_microsoft/adb2spark.git
git@gitee.com:mirrors_microsoft/adb2spark.git
mirrors_microsoft
adb2spark
adb2spark
main

搜索帮助