{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "29f8d24e-e4bf-484d-afd4-cb82ff6cd50d", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "25/01/31 22:57:42 WARN SparkSession: Using an existing Spark session; only runtime SQL configurations will take effect.\n" ] }, { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namespace
orders
" ], "text/plain": [ "+-----------+\n", "| namespace |\n", "+-----------+\n", "| orders |\n", "+-----------+" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%sql\n", "\n", "SHOW DATABASES" ] }, { "cell_type": "code", "execution_count": 2, "id": "70349765-e5f1-43a5-a141-cc2d54c69a58", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namespacetableNameisTemporary
orderspaymentsFalse
" ], "text/plain": [ "+-----------+-----------+-------------+\n", "| namespace | tableName | isTemporary |\n", "+-----------+-----------+-------------+\n", "| orders | payments | False |\n", "+-----------+-----------+-------------+" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%sql\n", "\n", "SHOW TABLES FROM orders" ] }, { "cell_type": "code", "execution_count": 3, "id": "fabaed9c-9049-4996-9d26-b20f66303911", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
keyvalue
current-snapshot-idnone
formaticeberg/parquet
format-version2
write.parquet.compression-codeczstd
" ], "text/plain": [ "+---------------------------------+-----------------+\n", "| key | value |\n", "+---------------------------------+-----------------+\n", "| current-snapshot-id | none |\n", "| format | iceberg/parquet |\n", "| format-version | 2 |\n", "| write.parquet.compression-codec | zstd |\n", "+---------------------------------+-----------------+" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%sql\n", "\n", "SHOW TBLPROPERTIES orders.payments" ] }, { "cell_type": "code", "execution_count": 4, "id": "6317d9c6-140e-4a63-890e-2173fbb9503e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
count(1)
0
" ], "text/plain": [ "+----------+\n", "| count(1) |\n", "+----------+\n", "| 0 |\n", "+----------+" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%sql\n", "\n", "SELECT COUNT(*)\n", "FROM orders.payments" ] }, { "cell_type": "code", "execution_count": 5, "id": "2a1ff132-dc65-4943-a9be-416ba5a13c26", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idtypecreated_atdocumentpayeramount
" ], "text/plain": [ "+----+------+------------+----------+-------+--------+\n", "| id | type | created_at | document | payer | amount |\n", "+----+------+------------+----------+-------+--------+\n", "+----+------+------------+----------+-------+--------+" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%sql\n", "\n", "SELECT *\n", "FROM orders.payments\n", "LIMIT 10" ] }, { "cell_type": "code", "execution_count": 6, "id": "a2688a95-594c-45ad-9d49-70a1bcd59a1b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
partitionspec_idrecord_countfile_counttotal_data_file_size_in_bytesposition_delete_record_countposition_delete_file_countequality_delete_record_countequality_delete_file_countlast_updated_atlast_updated_snapshot_id
" ], "text/plain": [ "+-----------+---------+--------------+------------+-------------------------------+------------------------------+----------------------------+------------------------------+----------------------------+-----------------+--------------------------+\n", "| partition | spec_id | record_count | file_count | total_data_file_size_in_bytes | position_delete_record_count | position_delete_file_count | equality_delete_record_count | equality_delete_file_count | last_updated_at | last_updated_snapshot_id |\n", "+-----------+---------+--------------+------------+-------------------------------+------------------------------+----------------------------+------------------------------+----------------------------+-----------------+--------------------------+\n", "+-----------+---------+--------------+------------+-------------------------------+------------------------------+----------------------------+------------------------------+----------------------------+-----------------+--------------------------+" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%sql\n", "\n", "SELECT * \n", "FROM orders.payments.partitions\n", "ORDER BY record_count DESC\n", "LIMIT 10" ] }, { "cell_type": "code", "execution_count": null, "id": "72b17cc4-6c92-47b7-9b86-ae6a7f73af4d", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.18" } }, "nbformat": 4, "nbformat_minor": 5 }