How Hive Native Works¶
Hive Native reads table information from the metastore and then reads the data files straight from storage. This page follows one read from start to finish on a Kerberized HDFS cluster: which service Qualytics talks to at each step, on which port, and where your cluster's access policies are applied.
Every connection in this flow is opened by your Qualytics deployment toward your cluster. Nothing on the cluster opens a connection back to Qualytics.
Services involved¶
flowchart TD
Q["Qualytics deployment"]
subgraph Cluster["Your Hive cluster"]
KDC["Kerberos KDC"]
HMS["Hive metastore"]
NN["HDFS NameNodes"]
DN["HDFS DataNodes"]
KMS["Key Management Server<br/>(encryption zones only)"]
end
Q -->|"88"| KDC
Q -->|"9083"| HMS
Q -->|"8020"| NN
Q -->|"1004 or 9866"| DN
Q -.->|"9494 HTTPS"| KMS
The ports shown are the common defaults, and your cluster may use different ones. Permissions lists each service and how to check its port.
A read, step by step¶
The first four steps prepare the connection and are reused across operations. The last three run for every data file an operation opens.
sequenceDiagram
participant Q as Qualytics
participant KDC as Kerberos KDC
participant HMS as Hive metastore
participant NN as NameNodes
participant KMS as Key Management Server
participant DN as DataNodes
rect rgba(127, 127, 127, 0.08)
Note over Q,DN: Setup, reused across operations
Q->>KDC: 1. Log in with the keytab (88)
Q->>HMS: 2. Read tables, columns, and partition locations (9083)
Q->>NN: 3. Get an HDFS delegation token (8020)
Q->>KMS: 4. Get a KMS delegation token (9494)
end
rect rgba(127, 127, 127, 0.16)
Note over Q,DN: For each data file
Q->>NN: 5. Open the file: permission check and block locations (8020)
Q->>KMS: 6. Decrypt the file's key (9494)
Q->>DN: 7. Read the file's blocks (1004 or 9866)
end
Note over Q: Decrypt in memory and compute results
- Log in. Qualytics authenticates to the KDC as the connection's Client Principal, using the keytab stored on the connection. A connection with no keytab of its own logs in with the deployment's principal and keytab instead, which only older self-hosted deployments have. See Hive Native Authentication.
- Read the metastore. Databases, tables, columns, and the location of every table and partition come from the metastore. Partitions are taken from the metastore rather than from listing storage, unless the connection reads partition folders the metastore does not know.
- Get an HDFS delegation token. The token lets the processes that read files act as the same principal without each one logging in to Kerberos. Qualytics requests a fresh one every few hours, well before it expires.
- Get a KMS delegation token. When the cluster runs a Key Management Server, a KMS token is requested alongside the HDFS token. If the KMS cannot be reached, reads outside encryption zones still work, while reads inside one fail with a decryption error.
- Open the file. The NameNode checks that the principal may read the file and returns where its blocks are. This is where your HDFS permissions and Ranger HDFS policies apply.
- Decrypt the file's key. Only for files in an HDFS encryption zone. The NameNode hands back the file's key in encrypted form, and Qualytics asks the KMS to decrypt it. This is where your Ranger KMS policies apply. See Encryption zones.
- Read the blocks. The DataNodes serve the file's blocks. For an encrypted file, the blocks travel as ciphertext.
Steps 4 and 6 are the only ones that reach the KMS. Step 4 runs whenever the NameNode reports a KMS for the cluster, and step 6 only for files in an encryption zone. Tables in Amazon S3, Azure Data Lake Storage, or Google Cloud Storage skip steps 3 to 7, because their files are read from object storage with the credentials your deployment is already configured with.
Partition folders the metastore does not know¶
By default, Qualytics reads only the partitions registered in the metastore. Data copied into a new partition folder, such as dt=2026-11-24/ under the table's location, is not read until the partition is added in Hive, for example with ALTER TABLE ... ADD PARTITION or MSCK REPAIR TABLE.
Turn on Read Unregistered Partition Folders on the connection to read those folders too. It applies to every datastore on the connection, and to every operation and preview on their partitioned tables. With it on:
- Each folder becomes a partition. A
column=valuefolder at the last partition level under the table's location, that the metastore has no partition for, is read as a partition in the table's own format. - A registered partition always wins. A folder naming the same values as a registered partition adds nothing. A folder that is a registered partition's location, but is named for another value (for example, a partition
dt=2026-11-24stored in a folder nameddt=2026-11-23), adds nothing once Qualytics has listed the table's partitions in full. Before that, a read such as a preview can take that folder as a partition of its own too, so its rows come back twice, once under each value. - Leftover files are read too. Dropping an external partition in Hive leaves its folder and files in place, and those files are read again. Remove such folders, or keep the setting off, when their data should not be checked.
- Some folders are still left out. A folder with an empty value, or with a value its partition column cannot hold (such as
month=abcon an integer column), is not read. Of two folders naming the same partition, such asday=1andday=01, only one is read.
The setting is off by default because a folder is not proof of a partition: reading every folder can pick up data your Hive users do not see.
Large partitioned tables¶
A partitioned Hive table can hold thousands of partitions and billions of rows. Qualytics reads such a table so that an operation costs about as much as the data it needs, not as much as the whole table.
Newest partitions first¶
A preview, and a profile or scan with a record limit, read the newest partitions first. Newest means the highest partition values, compared as the type each partition column is declared with, so on an integer hour column 23 is newer than 9.
- A profile or scan with a record limit on a partitioned table that holds more rows than the limit reads whole partitions, newest first, until it has enough rows, and cuts only the oldest of them short. It never returns more rows than the limit, and can return fewer, for example when Hive's statistics for those partitions are out of date. Partitions with no row to read are skipped. On a table whose first partition column holds dates as text (see below), partitions whose value is not a date are read last.
- A preview shows rows from the newest partitions. A preview with a filter keeps searching older partitions until it has the rows it needs or has searched every partition, so a filter that matches few rows, or none, can take about as long as reading the whole table.
A limited operation therefore checks the newest data rather than a sample spread across the whole table. A check inferred from a profile of older data can raise anomalies the first time a limited scan reads only the newest partitions.
Row counts¶
A profile does not count the rows of a table, and a scan counts them only when it runs a Min Partition Size or Max Partition Size check, which need the record count. That count covers the records the scan selects: only the new ones on an Incremental scan, and only the matching ones when the scan has a filter. On a very large table, counting every row can take longer than reading the records the operation needs.
A Computed Table follows the same rule. Its query is not run a second time to count its rows unless the scan runs one of those checks, or a computed field on the table uses a window or aggregate function, which needs every row. The total it reports is the number of rows it read, when it read them all.
The total an operation reports comes from the rows it read, when it read every row, or from the row count in Hive's table statistics. When Hive's statistics are out of date, that total can differ from an exact count. When neither is available, the operation reports no total. See Keep Hive's table statistics current.
Incremental scans on a text partition column¶
Many Hive tables are partitioned by a date or a batch number stored as text, such as datepart='20261112'. Text compares character by character, which puts 9 after 10, so a field the source stores as text normally cannot be an incremental field. On Hive Native the table's first partition column is the exception. Qualytics reads its values from the partition names in the metastore, puts them in order as dates or as numbers, and an incremental scan reads only the partitions after the last one it scanned, without listing or opening the older ones.
| The first partition column holds | Incremental field | How it is set |
|---|---|---|
| Dates or date-times as text | Last Modified | Sync sets it when the table has no incremental field |
| Batch numbers as text | Batch Value | You set it in the table's Identifiers |
Dates as text. Qualytics recognizes a first partition column declared as string when more than half of its values are real dates in one of these formats, with years from 1900 to 2200:
| Format | Example value |
|---|---|
yyyyMMdd |
20261112 |
yyyy-MM-dd |
2026-11-12 |
yyyyMMddHH |
2026111215 |
yyyyMMddHHmm |
202611121530 |
yyyyMMddHHmmss |
20261112153045 |
yyyy-MM-dd-HH |
2026-11-12-15 |
yyyy-MM-dd HH:mm |
2026-11-12 15:30 |
yyyy-MM-dd HH:mm:ss |
2026-11-12 15:30:45 |
Only formats whose text order is also their time order are recognized. Formats such as dd-MM-yyyy or MM/dd/yyyy, and month or year values such as yyyyMM or yyyy, are not, because short numeric IDs could be mistaken for them. Values are read as UTC.
When Sync finds such a column, it sets the column as the table's Last Modified field, both when it creates the container and when it refreshes one that has no incremental field. It never replaces an incremental field that is already set. A table whose incremental field is another column is read by that column instead, and you can switch it to the partition column in the table's settings.
An incremental scan then reads the partitions after the newest one it already scanned, to the unit of the format: whole days for yyyyMMdd, whole hours for yyyyMMddHH. The newest partition read becomes the next scan's starting point. Rows added later to a partition that was already scanned are not read by the next incremental scan. To cover them, run an Incremental scan with a Greater Than Time Starting Threshold before that partition, or a Full scan.
Batch numbers as text. Set the column as the table's Batch Value field. Qualytics reads its values as whole numbers, so batch 10 follows batch 9, and an incremental scan reads only the batches greater than the last one it scanned. The number is only an order and is never read as a time. A value counts as a number when it is plain digits, at most 16 of them, no larger than 9,007,199,254,740,992. An epoch in nanoseconds, for example, is too large.
There is no limit on how many new batches one incremental scan reads. When more than 1,000 batches follow the last one scanned, for example after a long pause between scans, the scan still reads all of them, and only them, in that one scan. To find them, though, Qualytics fetches the details of every partition of the table from the metastore, as a Full scan does, so on a table with many partitions that scan takes longer to start. No warning is shown.
On Hive Native, any field stored as text can be picked as the Batch Value field, but a scan fails with a configuration error when that field is not the table's first partition column. See A Scan Fails Over a Text Incremental Field.
Values that are not dates or numbers. A partition whose value is not a date, or not a whole number for a batch column, such as a stray datepart='test', is left out of incremental scans. A Full scan still reads it. The operation reports a warning on the table, with the code non_date_partitions_skipped or non_numeric_partitions_skipped, that names the column and up to five of the values. See A Warning Says Partitions Were Left Out of Incremental Scans.
Incremental scans by File Last Modified Time¶
The File Last Modified Time incremental strategy picks the partitions to read from storage rather than from a field. It needs no incremental field, so it also covers tables the other strategies cannot follow: tables without a detected date partition column, tables partitioned by something other than a date (a region or a source system, for example), and unpartitioned tables. It is offered only for tables of a Hive Native datastore, and you pick it in the table's Identifiers. Sync never sets it and never replaces it with a partition column it detects.
Qualytics lists the partition directories under the table location and reads when each one last changed. A directory changes when files are added to it, removed from it, or replaced in it. An Incremental scan then reads only the partitions whose directory changed after the last scan, and the newest of those times becomes the next scan's starting point.
| Incremental scan | What it reads |
|---|---|
| The first one, or the first after the table switches to or from File Last Modified Time | Every partition. The newest directory time becomes the starting point |
| Every later one | The partitions whose directory changed since the last scan |
| With a Greater Than Time Starting Threshold | The partitions whose directory changed after that time |
| On an unpartitioned table | The whole table when files in its directory changed, otherwise nothing |
A few points follow from reading by directory:
- A changed partition is read whole. Every file in it is read again, including files an earlier scan already checked, because the directory time cannot tell which files are new.
- Only partitions the metastore knows are read. A directory under the table location with no matching partition in the metastore is skipped, and the scan's results say how many changed folders were skipped because they did not match a partition registered in Hive. To read them, turn on Read Unregistered Partition Folders.
- A directory moved into place in one step can be missed. A partition directory renamed or moved under the table location keeps the time it had before the move, so a scan whose starting point is later than that time does not read it.
- Switching strategies restarts the count. A table that switches to or from File Last Modified Time loses its starting point, because a directory time and a field value cannot stand in for each other. A scan started before the switch does not set a new one when it finishes.
- A window function reads every row. On a table with a computed field that uses a window function, such as
LAGorSUM(...) OVER (...), an Incremental scan reads the whole table, because the function needs every row. It still records the newest directory time.
Some tables cannot be judged by directory time. An Incremental scan then reads the whole table, as a Full scan does, and records no starting point, so the next Incremental scan reads the whole table again. No warning is shown. That happens when:
- The table is stored in Amazon S3, Azure Data Lake Storage, or Google Cloud Storage. Object storage keeps no modification time for directories, so File Last Modified Time works only for tables on HDFS.
- Two directories under the table location name the same partition.
- A partition the scan would read is stored outside its own directory under the table location, for example after
ALTER TABLE ... PARTITION ... SET LOCATION. - On the first Incremental scan, a partition registered in the metastore has no directory under the table location.
Record limits and incremental scans¶
A scan with a record limit can leave some of the records it selected unread, and the next Incremental scan does not always go back for them. Where that scan starts depends on the table's incremental strategy and field:
- The first partition column, holding dates or batch numbers as text. The next scan starts after the newest partition of the table, even when the limit stopped the scan before it reached the older ones. Partitions the limit left out are not read by later Incremental scans.
- File Last Modified Time. An Incremental scan that has a starting point fills the limit from the changed partitions without putting the newest first. The next scan starts after the newest directory time among all the changed partitions, even those the limit left unread. A partition the limit left out is read again only when its files change.
- Any other incremental field, such as a timestamp or numeric column. The next scan starts after the highest value among the records the scan read. Records the limit left out are read by a later Incremental scan only when their value is higher than that.
- Any other incremental field, on a scan that counts its records (one that runs a Min Partition Size or Max Partition Size check, see Row counts), or when the field is a computed field or one of the table's excluded fields. The next scan starts after the highest value among all the records the scan selected, including those the limit left out, so later Incremental scans do not read them.
To check records that a limited scan left out, run a Full scan, or an Incremental scan with a Starting Threshold before them, without a record limit.
Encryption zones¶
On clusters that use HDFS transparent encryption, such as Cloudera CDP with Ranger KMS, the files of an encryption zone are stored encrypted, and only the client that reads them decrypts them. The NameNode holds each file's key in encrypted form and the DataNodes hold ciphertext, so nothing on the cluster can hand plaintext to a reader that goes straight to the files. That is why Hive Native, unlike the Hive connector, needs to reach the KMS.
| What the principal needs | Why |
|---|---|
| Decrypt EEK on the zone key | Decrypts each file's key when the file is opened |
That is the only KMS permission involved:
- The zone key itself never leaves the KMS.
- Decrypt EEK gives no access to key material and no ability to list, create, roll, or delete keys.
- Every decrypt call is recorded in the KMS audit log under the principal Qualytics logs in as in step 1.
- Revoking that one permission stops all reads from the zone, even while HDFS access is still granted.
Decryption happens in memory inside your Qualytics deployment, on the data being profiled or scanned.
What Qualytics does not do¶
- It does not write to your cluster. The connector cannot create, alter, or drop databases or tables through the metastore, and it does not write files to your HDFS.
- It does not apply Hive's fine-grained policies. Because the data files are read directly, Ranger Hive column masking and row filters are not applied. Access is decided by the HDFS and KMS checks in steps 5 and 6. Use the Hive connector for tables that depend on Hive-level policies.
- It does not need administrative access. No HDFS web UIs, WebHDFS, HttpFS, Cloudera Manager, Ranger admin, or SSH access is required.
See Also¶
-
Authentication
Kerberos on this connector: the service principal, the keytab Qualytics presents, and the
krb5.confthat reaches the realm. -
Examples
Worked scenarios: a partitioned Parquet warehouse, a database of mixed formats, object storage, and two Kerberized clusters.
-
Best Practices
Recommendations for planning the connection, splitting tables between the two Hive connectors, and keeping operations fast.
-
Permissions
The access your Hive cluster must grant.