Modify the README files for top-level, Python, and Java (#9)
* Modify the README files for top-level, Python, and Java * fix \ * update link
This commit is contained in:
Родитель
276da98095
Коммит
a951543182
26
README.md
26
README.md
|
@ -5,28 +5,26 @@ Welcome to the SQL Server Language Extensions project!
|
|||
|
||||
Starting in SQL Server 2019, we have added support for language extensibility, which means that you can now execute code in various languages like R, Python and Java from SQL Server.
|
||||
|
||||
To download the released prebuilt versions of these extensions, go to the [Releases section of this repository](https://github.com/microsoft/sql-server-language-extensions/releases). Download the latest version of whichever extension corresponds to your machine configuration (Windows or Linux). There are separate releases for each language extension.
|
||||
|
||||
We hope you enjoy using Microsoft SQL Server and the language extension feature.
|
||||
|
||||
-SQL Server Team
|
||||
|
||||
## Announcements
|
||||
|
||||
* In SQL Server 2019, we are open sourcing the SDK for our Java language extension: [**Microsoft Extensibility SDK for Java for Microsoft SQL Server**](https://github.com/microsoft/sql-server-language-extensions/tree/master/language-extensions/java/sdk)
|
||||
|
||||
## Things to Know
|
||||
|
||||
* The Java components in this project are built on Java 8
|
||||
* The SDK is also installed as part of SQL Server 2019 on both Windows as Linux
|
||||
* Default installation path on Windows: [instance installation home directory]\MSSQL\Binn\mssql-java-lang-extension.jar
|
||||
* Default installation path on Linux: /opt/mssql/lib/mssql-java-lang-extension.jar
|
||||
|
||||
## Documentation
|
||||
|
||||
You can read more about how to use language extensions in SQL Server 2019 in the Microsoft [documentation](https://docs.microsoft.com/en-us/sql/language-extensions/language-extensions-overview?view=sqlallproducts-allversions).
|
||||
You can read more about how to use language extensions and how to use Java in SQL Server 2019 in the Microsoft [documentation](https://docs.microsoft.com/en-us/sql/language-extensions/language-extensions-overview?view=sqlallproducts-allversions).
|
||||
|
||||
## Get Started
|
||||
Tutorials and documentation for the R and Python extensions can be found here:
|
||||
|
||||
This [tutorial](https://docs.microsoft.com/en-us/sql/language-extensions/tutorials/search-for-string-using-regular-expressions-in-java?view=sqlallproducts-allversions) will walk you through an end to end sample using the Java language extension for SQL Server. Sample code files for the tutorial can also be found under samples in this repository. [Sample code files](https://github.com/microsoft/sql-server-language-extensions/tree/master/language-extensions/java/samples/regex) are also available in this repository.
|
||||
[Python Documentation](https://docs.microsoft.com/en-us/sql/machine-learning/install/custom-runtime-python?view=sql-server-ver15)
|
||||
|
||||
[R Documentation](https://docs.microsoft.com/en-us/sql/machine-learning/install/custom-runtime-r?view=sql-server-ver15)
|
||||
|
||||
## Custom Builds
|
||||
|
||||
To build your own version of the language extensions, refer to each respective language's README file. \
|
||||
For example, to modify and build a custom version of the R Extension, go to [language-extensions/R/README.md](language-extensions/R/README.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -7,31 +7,51 @@ For more information about SQL Server Language Extensions, refer to this [docume
|
|||
|
||||
The Java extension version in this repository is compatible with SQL Server 2019 CU3 onwards.
|
||||
|
||||
This [tutorial](https://docs.microsoft.com/en-us/sql/language-extensions/tutorials/search-for-string-using-regular-expressions-in-java?view=sqlallproducts-allversions) will walk you through an end to end sample using the Java language extension for SQL Server. Sample code files for the tutorial can also be found under samples in this repository. [Sample code files](./samples/regex) are also available in this repository.
|
||||
|
||||
|
||||
|
||||
## Things to Know
|
||||
|
||||
* The Java components in this project are built on Java 8
|
||||
* The [**Microsoft Extensibility SDK for Java**](sdk) is also installed as part of SQL Server 2019 on both Windows as Linux
|
||||
* Default installation path on Windows: [instance installation home directory]\MSSQL\Binn\mssql-java-lang-extension.jar
|
||||
* Default installation path on Linux: /opt/mssql/lib/mssql-java-lang-extension.jar
|
||||
|
||||
## Building
|
||||
|
||||
#### Windows
|
||||
1) Install [CMake for Windows](https://cmake.org/download/) and Java ([file](https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk) and [instructions](https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/InstallingZulu/InstallWindowsUsingZuluZIPFile.htm))
|
||||
2) Install C++ Tools for CMake from the [Build Tools for Visual Studio 2017](https://my.visualstudio.com/Downloads?q=visual%20studio%202017&wt.mc_id=o~msft~vscom~older-downloads).
|
||||
### Windows
|
||||
|
||||
1. Install [CMake for Windows](https://cmake.org/download/) and Java ([file](https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk) and [instructions](https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/InstallingZulu/InstallWindowsUsingZuluZIPFile.htm))
|
||||
|
||||
1. Install C++ Tools for CMake from the [Build Tools for Visual Studio 2017](https://my.visualstudio.com/Downloads?q=visual%20studio%202017&wt.mc_id=o~msft~vscom~older-downloads).
|
||||
Download the Visual Studio 2017 Build Tools installer and check the **Visual C++ build tools** option under Workloads. In the sidebar on the right, make sure **Visual C++ tools for CMake** is checked, then install.
|
||||
3) Set CMAKE_ROOT and JAVA_HOME pointing to the respective folders
|
||||
4) Run **build-java-extension.cmd** which will generate two main files: \
|
||||
|
||||
1. Set CMAKE_ROOT and JAVA_HOME pointing to the respective folders.
|
||||
|
||||
1. Run [**build-java-extension.cmd**](build/windows/build-java-extension.cmd) which will generate two main files: \
|
||||
- PATH\TO\ENLISTMENT\build-output\java-extension\windows\release\release\java-extension.dll \
|
||||
- PATH\TO\ENLISTMENT\build-output\java-extension\target\release\mssql-java-lang-extension.jar
|
||||
5) Run **create-java-extension-zip.cmd** which will generate: \
|
||||
|
||||
1. Run [**create-java-extension-zip.cmd**](build/windows/create-java-extension-zip.cmd) which will generate: \
|
||||
- PATH\TO\ENLISTMENT\build-output\java-extension\windows\release\release\packages\java-lang-extension.zip \
|
||||
This zip can be used in CREATE EXTERNAL LANGUAGE, as detailed in the tutorial in the Usage section below.
|
||||
|
||||
#### Linux
|
||||
1) Install [CMake for Linux](https://cmake.org/download/) and [Java](https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/InstallingZulu/InstallOnLinuxUsingAPTRepository.htm)
|
||||
2) Set JAVA_HOME pointing to the Java folder
|
||||
3) Run **build-java-extension.sh** which will generate two main files: \
|
||||
### Linux
|
||||
|
||||
1. Install [CMake for Linux](https://cmake.org/download/) and [Java](https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/InstallingZulu/InstallOnLinuxUsingAPTRepository.htm)
|
||||
|
||||
1. Set JAVA_HOME pointing to the Java folder.
|
||||
|
||||
1. Run [**build-java-extension.sh**](build/linux/build-java-extension.sh) which will generate two main files: \
|
||||
- PATH/TO/ENLISTMENT/build-output/java-extension/linux/release/libJavaExtension.so.1.0 \
|
||||
- PATH/TO/ENLISTMENT/build-output/java-extension/target/release/mssql-java-lang-extension.jar
|
||||
4) Run **create-java-extension-zip.sh** which will generate: \
|
||||
|
||||
1. Run [**create-java-extension-zip.sh**](build/linux/create-java-extension-zip.sh) which will generate: \
|
||||
- PATH/TO/ENLISTMENT/build-output/java-extension/linux/release/packages/java-lang-extension.zip \
|
||||
This zip can be used in CREATE EXTERNAL LANGUAGE, as detailed in the tutorial in the Usage section below.
|
||||
|
||||
## Usage
|
||||
After creating the Java extension zip, use CREATE EXTERNAL LANGUAGE to create the language on the SQL Server.
|
||||
After creating the Java extension zip, use [CREATE EXTERNAL LANGUAGE](https://docs.microsoft.com/en-us/sql/t-sql/statements/create-external-language-transact-sql?view=sql-server-ver15) to create the language on the SQL Server.
|
||||
|
||||
This [tutorial](https://docs.microsoft.com/en-us/sql/language-extensions/tutorials/search-for-string-using-regular-expressions-in-java?view=sqlallproducts-allversions) will walk you through an end to end sample using the Java language extension.
|
||||
|
|
|
@ -7,7 +7,7 @@ For more information about SQL Server Language Extensions, refer to this [docume
|
|||
|
||||
The Python extension version in this repository is compatible with SQL Server 2019 CU3 onwards.
|
||||
|
||||
Note that the Python Extension released in the current repository works with Python 3.7.x - to use the released package, follow (this tutorial)[https://docs.microsoft.com/en-us/sql/machine-learning/install/custom-runtime-py?view=sql-server-ver15]. For any other version of Python (3.6, 3.8, etc) you must modify and rebuild the Python Extension binaries using the following instructions.
|
||||
Note that the Python Extension released in the current repository works with Python 3.7.x - to use the released package, follow [this tutorial](https://docs.microsoft.com/en-us/sql/machine-learning/install/custom-runtime-python?view=sql-server-ver15). For any other version of Python (3.6, 3.8, etc) you must modify and rebuild the Python Extension binaries using the following instructions.
|
||||
|
||||
## Building
|
||||
|
||||
|
@ -23,12 +23,14 @@ Note that the Python Extension released in the current repository works with Pyt
|
|||
|
||||
1. Set CMAKE_ROOT, PYTHONHOME, and BOOST_ROOT pointing to their respective installation and build folders.
|
||||
|
||||
1. Modify [**language-extensions\python\src\CMakeLists.txt**](.\src\CMakeLists.txt). Change each `find_library` call to point to your custom python and boost libraries.
|
||||
1. Modify [**CMakeLists.txt**](src/CMakeLists.txt). Change each `find_library` call to point to your custom python and boost libraries.
|
||||
|
||||
1. Run [**build-python-extension.cmd**](.\build\windows\build-python-extension.cmd) which will generate: \
|
||||
1. Modify [**PythonExtension.cpp**](src/PythonExtension.cpp). Change the value of `x_PythonSoFile` on line 37 to the name of your python so library file.
|
||||
|
||||
1. Run [**build-python-extension.cmd**](build/windows/build-python-extension.cmd) which will generate: \
|
||||
- PATH\TO\ENLISTMENT\build-output\pythonextension\windows\release\release\pythonextension.dll
|
||||
|
||||
1. Run [**create-python-extension-zip.cmd**](.\build\windows\create-python-extension-zip.cmd) which will generate: \
|
||||
1. Run [**create-python-extension-zip.cmd**](build/windows/create-python-extension-zip.cmd) which will generate: \
|
||||
- PATH\TO\ENLISTMENT\build-output\pythonextension\windows\release\release\packages\python-lang-extension.zip \
|
||||
This zip can be used in CREATE EXTERNAL LANGUAGE, as detailed in the tutorial in the Usage section below.
|
||||
|
||||
|
@ -41,16 +43,43 @@ Note that the Python Extension released in the current repository works with Pyt
|
|||
|
||||
1. Set PYTHONHOME and BOOST_ROOT to point to your python installation and boost build folder respectively.
|
||||
|
||||
1. Modify [**language-extensions\python\src\CMakeLists.txt**](.\src\CMakeLists.txt). Change each `find_library` call to point to your custom python and boost libraries.
|
||||
1. Modify [**CMakeLists.txt**](src/CMakeLists.txt). Change each `find_library` call to point to your custom python and boost libraries.
|
||||
|
||||
1. Run [**build-python-extension.sh**](.\build\linux\build-python-extension.sh) which will generate: \
|
||||
1. Run [**build-python-extension.sh**](build/linux/build-python-extension.sh) which will generate: \
|
||||
- PATH/TO/ENLISTMENT/build-output/pythonextension/linux/release/libPythonExtension.so.1.0
|
||||
|
||||
1. Run [**create-python-extension-zip.sh**](.\build\linux\create-python-extension-zip.sh) which will generate: \
|
||||
1. Run [**create-python-extension-zip.sh**](build/linux/create-python-extension-zip.sh) which will generate: \
|
||||
- PATH/TO/ENLISTMENT/build-output/pythonextension/linux/release/packages/python-lang-extension.zip \
|
||||
This zip can be used in CREATE EXTERNAL LANGUAGE, as detailed in the tutorial in the Usage section below.
|
||||
This zip can be used in CREATE EXTERNAL LANGUAGE, as detailed in the tutorial in the [Usage](#usage) section below.
|
||||
|
||||
## Testing (Optional)
|
||||
|
||||
### Windows
|
||||
To unit test this extension,
|
||||
|
||||
1. Install [CMake for Windows](https://cmake.org/download/). Set CMAKE_ROOT to point to the cmake installation folder. \
|
||||
|
||||
1. Download or build (GoogleTest)[https://github.com/google/googletest]. \
|
||||
|
||||
1. Run [**build-pythonextension-test.cmd**](test/build/windows/build-pythonextension-test.cmd) which will generate: \
|
||||
- PATH\TO\ENLISTMENT\build-output\pythonextension-test\windows\release\pythonextension-test.exe
|
||||
|
||||
1. Modify [**run-pythonextension-test.cmd**](test/build/windows/run-pythonextension-test.cmd) to point `GTEST_HOME` and `GTEST_LIB_PATH` to your GTest binaries.
|
||||
|
||||
1. Run [**run-pythonextension-test.cmd**](test/build/windows/run-pythonextension-test.cmd) to run all the unit tests.
|
||||
|
||||
### Linux
|
||||
To unit test this extension,
|
||||
|
||||
1. Run [**build-googletest.sh**](../../test/googletest/build/linux/build-googletest.sh) which will generate the gtest library essential to build the pythonextension-test binary: \
|
||||
- /PATH/TO/ENLISTMENT/build-output/googletest/linux/lib/libgtest.a
|
||||
|
||||
1. Run [**build-pythonextension-test.sh**](test/build/linux/build-pythonextension-test.sh) which will generate: \
|
||||
- /PATH/TO/ENLISTMENT/build-output/pythonextension-test/windows/release/pythonextension-test.exe
|
||||
|
||||
1. Run [**run-pythonextension-test.sh**](test/build/linux/run-pythonextension-test.sh) to run all the unit tests.
|
||||
|
||||
## Usage
|
||||
After downloading or building the Python extension zip, use CREATE EXTERNAL LANGUAGE to create the language on the SQL Server.
|
||||
After downloading or building the Python extension zip, use [CREATE EXTERNAL LANGUAGE](https://docs.microsoft.com/en-us/sql/t-sql/statements/create-external-language-transact-sql?view=sql-server-ver15) to create the language on the SQL Server.
|
||||
|
||||
This [tutorial](https://docs.microsoft.com/en-us/sql/machine-learning/install/custom-runtime-py?view=sql-server-ver15) will walk you through an end to end sample using the Python language extension.
|
||||
This [tutorial](https://docs.microsoft.com/en-us/sql/machine-learning/install/custom-runtime-python?view=sql-server-ver15) will walk you through an end to end sample using the Python language extension.
|
Загрузка…
Ссылка в новой задаче