Skip to content

When requesting sample data for partition column, the partition are not enclosed properly #3596

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

quadoss
Copy link
Collaborator

@quadoss quadoss commented Jan 5, 2024

Internal Jira: CDPD-65130

Steps to reproduce the issue:
CREATE External TABLE test_partiton_sample_record (id INT ,test STRING) PARTITIONED BY (InsertDate VARCHAR(10));

Alter table test_partiton_sample_record add partition (InsertDate='2023-01-01') Alter table test_partiton_sample_record add partition (InsertDate='2023-02-01')

Insert into test_partiton_sample_record PARTITION(InsertDate'2023-01-01') VALUES (2,'test') Insert into test_partiton_sample_record PARTITION(InsertDate'2023-02-01') VALUES (1,'test')

On the hue page, go to hive editor, click the table "!" mark and see the sample data is no loaded Go into the table browser and switch to the sample page, found the sample data is not displayed too.

The issue is because when considering the partition we check only from exact value but if it has a format like CHAR(1) we do not consider it as a CHAR and set this up with the below which will not return any records.

select * test_partiton_sample_record WHERE (InsertDate=2023-02-01) OR (InsertDate=2023-01-01) LIMIT 100

What changes were proposed in this pull request?

Add in a strip condition to get the needed information and then perform the validation

How was this patch tested?

Manually

…are not enclosed properly

Internal Jira: CDPD-65130

Steps to reproduce the issue:
CREATE External TABLE test_partiton_sample_record (id INT ,test STRING) PARTITIONED BY (InsertDate VARCHAR(10));

Alter table test_partiton_sample_record add partition (InsertDate='2023-01-01')
Alter table test_partiton_sample_record add partition (InsertDate='2023-02-01')

Insert into test_partiton_sample_record PARTITION(InsertDate'2023-01-01') VALUES (2,'test')
Insert into test_partiton_sample_record PARTITION(InsertDate'2023-02-01') VALUES (1,'test')

On the hue page, go to hive editor, click the table "!" mark and see the sample data is no loaded
Go into the table browser and switch to the sample page, found the sample data is not displayed too.

The issue is because when considering the partition we check only from exact value but if it has a format like CHAR(1) we do not consider it as a CHAR and set this up with the below which will not return any records.

select * test_partiton_sample_record WHERE (`InsertDate`=2023-02-01) OR (`InsertDate`=2023-01-01) LIMIT 100
@quadoss quadoss enabled auto-merge (squash) January 5, 2024 17:22
Harshg999

This comment was marked as outdated.

@github-actions github-actions bot added the Stale label Feb 21, 2024
@github-actions github-actions bot closed this Mar 3, 2024
auto-merge was automatically disabled March 3, 2024 01:48

Pull request was closed

@wing2fly wing2fly reopened this Apr 26, 2024
@github-actions github-actions bot closed this May 7, 2024
@quadoss quadoss reopened this Apr 16, 2025

This comment was marked as outdated.

@quadoss quadoss removed the Stale label Apr 16, 2025
@quadoss quadoss enabled auto-merge (squash) April 16, 2025 16:22
@quadoss quadoss removed the request for review from Akhilsnaik April 16, 2025 16:23
@cloudera cloudera deleted a comment from github-actions bot Apr 16, 2025
Copy link

github-actions bot commented Apr 16, 2025

Python Code Coverage

Python Coverage Report •
FileStmtsMissCoverMissing
apps/beeswax/src/beeswax/server
   hive_server2_lib.py95837261%70, 73–75, 87, 91, 97–99, 104, 111–113, 129–132, 156, 158, 183, 191–193, 205–212, 216–218, 230, 239–247, 249, 251, 261, 292, 301–304, 306, 331–344, 386, 396, 404, 407–408, 410, 428, 430–434, 437–438, 441, 449–452, 454–456, 458–459, 461–462, 464–469, 471–472, 474–482, 484–485, 487–489, 491, 496, 500–513, 518, 522, 526, 530, 534–546, 606–607, 651, 658, 676–677, 683, 690, 693, 696, 699, 702, 708, 711, 717–719, 726–727, 729, 731, 753–756, 770–771, 775–776, 787, 810–813, 826–835, 864, 920, 932–938, 940–941, 947–948, 950–951, 957, 959–966, 968–970, 972, 974–979, 981, 989–990, 1015, 1032, 1042, 1053, 1067–1068, 1071–1073, 1085, 1091, 1096–1097, 1099–1100, 1102, 1104, 1107–1109, 1112–1119, 1121–1122, 1124, 1130, 1153, 1163, 1165–1171, 1174–1175, 1178–1179, 1182–1184, 1186–1188, 1204–1206, 1234–1235, 1237, 1253, 1259–1260, 1262, 1264, 1270, 1295, 1304–1305, 1307, 1309, 1317, 1324–1327, 1329–1332, 1334–1336, 1340, 1353–1357, 1361, 1364, 1367, 1384, 1401, 1407, 1414, 1420, 1435–1437, 1440–1441, 1444–1446, 1449–1452, 1455–1457, 1459–1460, 1462, 1464, 1466, 1469–1470, 1473, 1476–1477, 1480, 1483, 1486, 1488–1489, 1491–1492, 1494, 1496, 1499–1500, 1503, 1519–1521, 1524–1525, 1528, 1531, 1535, 1542, 1549, 1554, 1557
TOTAL536002666950% 

Pytest Report

Tests Skipped Failures Errors Time
1083 106 💤 0 ❌ 0 🔥 6m 9s ⏱️

Copy link

github-actions bot commented Jun 1, 2025

This PR is stale because it has been open 45 days with no activity and is not labeled "Prevent stale". Remove "stale" label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jun 1, 2025
@bjornalm bjornalm removed the Stale label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants