Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hidden $entries column to Delta history table #24292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Nov 28, 2024

Description

This column will help us debug issues in transaction logs.
Made it hidden because it's too verbose and I expect most users don't read it in normal situations.

trino> SELECT "$entries" FROM delta.tpch."region$history";
                                                                                                                                                                                    >
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------>
 [ {                                                                                                                                                                                >
   "commitInfo" : {                                                                                                                                                                 >
     "version" : 0,                                                                                                                                                                 >
     "timestamp" : 1732757958696,                                                                                                                                                   >
     "userId" : "user",                                                                                                                                                             >
     "userName" : "user",                                                                                                                                                           >
     "operation" : "CREATE TABLE AS SELECT",                                                                                                                                        >
     "operationParameters" : {                                                                                                                                                      >
       "queryId" : "20241128_013918_00022_uqv5h"                                                                                                                                    >
     },                                                                                                                                                                             >
     "clusterId" : "trino-testversion-9d2263a9-9995-4887-a3ef-a0925b07dece",                                                                                                        >
     "readVersion" : 0,                                                                                                                                                             >
     "isolationLevel" : "WriteSerializable",                                                                                                                                        >
     "isBlindAppend" : true                                                                                                                                                         >
   }                                                                                                                                                                                >
 }, {                                                                                                                                                                               >
   "protocol" : {                                                                                                                                                                   >
     "minReaderVersion" : 1,                                                                                                                                                        >
     "minWriterVersion" : 2                                                                                                                                                         >
   }                                                                                                                                                                                >
 }, {                                                                                                                                                                               >
   "metaData" : {                                                                                                                                                                   >
     "id" : "cfb44e2c-4091-4b3b-ba6b-8a288c9e8fd0",                                                                                                                                 >
     "format" : {                                                                                                                                                                   >
       "provider" : "parquet",                                                                                                                                                      >
       "options" : { }                                                                                                                                                              >
     },                                                                                                                                                                             >
     "schemaString" : "{\"type\":\"struct\",\"fields\":[{\"name\":\"regionkey\",\"type\":\"long\",\"nullable\":true,\"metadata\":{}},{\"name\":\"name\",\"type\":\"string\",\"nullab>
     "partitionColumns" : [ ],                                                                                                                                                      >
     "configuration" : {                                                                                                                                                            >
       "delta.enableDeletionVectors" : "false"                                                                                                                                      >
     },                                                                                                                                                                             >
     "createdTime" : 1732757958696                                                                                                                                                  >
   }                                                                                                                                                                                >
 }, {                                                                                                                                                                               >
   "add" : {                                                                                                                                                                        >
     "path" : "20241128_013918_00022_uqv5h_8b7ae07b-9396-4fe7-b838-f87f539d0d21",                                                                                                   >
     "partitionValues" : { },                                                                                                                                                       >
     "size" : 937,                                                                                                                                                                  >
     "modificationTime" : 1732757958687,                                                                                                                                            >
     "dataChange" : true,                                                                                                                                                           >
     "stats" : "{\"numRecords\":5,\"minValues\":{\"regionkey\":0,\"name\":\"AFRICA\",\"comment\":\"ges. thinly even pinto beans ca\"},\"maxValues\":{\"regionkey\":4,\"name\":\"MIDD>
     "tags" : { }                                                                                                                                                                   >
   }                                                                                                                                                                                >
 } ]                                                                                                                                                                                >
(1 row)

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Nov 28, 2024
@github-actions github-actions bot added the delta-lake Delta Lake connector label Nov 28, 2024
@@ -236,6 +242,7 @@ private List<Page> buildPages(ConnectorSession session, List<CommitInfoEntry> co
pagesBuilder.appendBigint(commitInfoEntry.readVersion());
write(commitInfoEntry.isolationLevel(), pagesBuilder);
commitInfoEntry.isBlindAppend().ifPresentOrElse(pagesBuilder::appendBoolean, pagesBuilder::appendNull);
write(TRANSACTION_LOG_ENTRIES_CODEC.toJson(transaction.transactionEntries()), pagesBuilder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have it behind some property? I suppose it can have a lot of data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed delta-lake Delta Lake connector
Development

Successfully merging this pull request may close these issues.

3 participants