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 pyspark.sql.functions as F | |
| from pyspark.sql import DataFrame | |
| from pyspark.sql.types import LongType, StructField, StructType | |
| from pyspark.sql.window import Window | |
| def identity_column_with_zip_with_index(df: DataFrame, offset: int = 0) -> DataFrame: | |
| rdd_with_index = df.rdd.zipWithIndex() |
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
| copy ( | |
| select | |
| "json" | |
| from _duckdb_ui.notebook_versions | |
| where 1=1 | |
| and title = 'MySingleNotebook' | |
| and expires is null | |
| ) to 'exported-notebook.json'; |
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
| class FabricDuckDBConnection(): | |
| def __init__(self, config: dict = {}): | |
| self._registered_tables = [] | |
| self._connection = duckdb.connect(config=config) | |
| def __getattr__(self, name): | |
| return getattr(self._connection, name) | |
| def __dir__(self): |