This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import time | |
| import struct | |
| import sqlalchemy | |
| import pyodbc | |
| import notebookutils | |
| import pandas as pd | |
| from pyspark.sql import functions as fn | |
| from datetime import datetime | |
| import sempy.fabric as fabric |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ######################################################################################################## | |
| # Sample script to call the syncronisation between the Fabric Lakehouse and the SQL Endpoint | |
| # | |
| ## 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. | |
| # | |
| # This script is a workaround until the documented API is released: https://learn.microsoft.com/en-us/fabric/release-plan/data-warehouse#refresh-sql-analytics-endpoint-rest-api | |
| # | |
| #sempy version 0.4.0 or higher | |
| !pip install semantic-link --q | |
| import json |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create_new_table("control", False, False, False, False, False, False, False, False, False ) | |
| create_new_table("control", True, False, False, False, False, False, False, False, False ) | |
| create_new_table("control", False, True, False, False, False, False, False, False, False ) | |
| create_new_table("control", True, True, False, False, False, False, False, False, False ) | |
| create_new_table("control", False, False, True, False, False, False, False, False, False ) | |
| create_new_table("control", True, False, True, False, False, False, False, False, False ) | |
| create_new_table("control", False, True, True, False, False, False, False, False, False ) | |
| create_new_table("control", True, True, True, False, False, False, False, False, False ) | |
| create_new_table("control", False, False, False, True, False, False, False, False, False ) | |
| create_new_table("control", True, False, False, True, False, False, False, False, False ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_new_table(tablename, columnmapping,delete_vectors,partitions,columnmappingbyid,liquidclustering,optimize,vacuum,writeStatsAsStruct,writeStatsAsJson): | |
| # What the function does goes here | |
| # use the default sample table, publicholidays | |
| tablename = "PARQUET_2_0" | |
| if columnmapping==True and columnmappingbyid==False: | |
| tablename=tablename+"_columnmapping_by_name" | |
| if delete_vectors==True: | |
| tablename=tablename+"_delete_vectors" | |
| if partitions==True: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # details from Article : https://learn.microsoft.com/en-us/fabric/data-warehouse/collation | |
| # default collation is Latin1_General_100_BIN2_UTF8 | |
| # new collation is Latin1_General_100_CI_AS_KS_WS_SC_UTF8 | |
| #sempy version 0.4.0 or higher | |
| !pip install semantic-link --q | |
| import json | |
| import sempy.fabric as fabric | |
| from sempy.fabric.exceptions import FabricHTTPException, WorkspaceNotFoundException |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import struct | |
| import sqlalchemy | |
| import pyodbc | |
| import notebookutils | |
| import sempy.fabric as fabric | |
| import time | |
| from pyspark.sql import functions as fn | |
| from datetime import datetime | |
| def create_engine(connection_string : str): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import struct | |
| import sqlalchemy | |
| import pyodbc | |
| import notebookutils | |
| import sempy.fabric as fabric | |
| import time | |
| from pyspark.sql import functions as fn | |
| from datetime import datetime | |
| def create_engine(connection_string : str): |