Reputation: 31
I tried to query my data with this setup
CREATE EXTERNAL TABLE `tableName`(
`accountidalt` string,
`activitytype` string,
`alias` string,
`backuptaskid` string,
`batchid` string,
`endpoint` string,
`error` string,
`execdatetime` timestamp,
`extendedauditinfo` struct<ExportDestination:string,RestoreDestination:string,RestoreSource:string,SnapshotDate:bigint,TaskCreateDate:timestamp>,
`externalid` string,
`performedby` string,
`region` string,
`subsourcedetails` array<struct<DataAmount:struct<MDSize1:bigint,MDSize2:bigint,NetSize1:bigint,NetSize2:bigint,Selector:tinyint,Size1:bigint,Size2:bigint>,DeltaDataSize:bigint,EntitesCounter:int,ExecDuration:int,ExecutionStatus:string,SubTaskSource:string,TaskExecDateTime:timestamp>>,
`targetaccount` string,
`taskidalt` string,
`tasksource` string,
`tasktype` string,
`type` string,
`useridalt` string,
`id2` string)
PARTITIONED BY (
`userid` string,
`taskid` string,
`accountid` string,
`month` int,
`year` int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
's3://bucketName/'
TBLPROPERTIES (
'has_encrypted_data'='false',
'projection.accountid.type'='inject',
'projection.enabled'='true',
'projection.month.digits'='2',
'projection.month.range'='1,12',
'projection.month.type'='integer',
'projection.taskid.type'='inject',
'projection.userid.type'='inject',
'projection.year.range'='2018,2051',
'projection.year.type'='integer',
'storage.location.template'='s3://bucket-name/userid=${userid}/taskid=${taskid}/accountid=${accountid}/month=${month}-${year}/',
'transient_lastDdlTime'='1640094578')
This is the select I tried
SELECT alias
FROM "audits"."tableName"
where userid = '1b17397a-8d72-4910-b9ad-fd059a6c3258' and taskid='9edb7dbf-49c3-41fd-9e10-5e1df07656c3' and accountid = '[email protected]'
and "month" = 12 and "year" = 2020
this is my file location
3://bucketName/userid=1b17397a-8d72-4910-b9ad-fd059a6c3258/taskid=9edb7dbf-49c3-41fd-9e10-5e1df07656c3/accountid= aaaBBBBB @abc.org'/month=12-2020/
after failing, tried to create partition
ALTER TABLE tableName ADD
PARTITION (userid = '1b17397a-8d72-4910-b9ad-fd059a6c3258' , taskid='9edb7dbf-49c3-41fd-9e10-5e1df07656c3' , accountid = ‘aaaBBBBB @abc.org',
month = 12 , year = 2020) LOCATION 's3://bucketName/userid=1b17397a-8d72-4910-b9ad-fd059a6c3258/taskid=9edb7dbf-49c3-41fd-9e10-5e1df07656c3/[email protected]/month=12-2020/';
I am sure I have data in the location
Got GENERIC_INTERNAL_ERROR: No value present
Same question was asked, but this setup is after applying recomendation from the answer
Thanks for any help
Upvotes: 1
Views: 2555
Reputation: 31
For anyone that had this kind of problem, I had a typo in:
'projection.taskid.type'='inject'
(All off them)
This should be injected
.
I suspect that the error will be the same for other types of wrong types.
Upvotes: 2