El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ MapReduce Service/ Troubleshooting/ Using Hive/ Abnormal Hive Query Due to Damaged Data in the JSON Table

Abnormal Hive Query Due to Damaged Data in the JSON Table

Updated on 2022-12-09 GMT+08:00

Issue

A user fails to query JSON data on the Hive client because the JSON table contains damaged data.

  1. On the Hive client, the user executes the default open-source serialized JSON statement to create a table.

    create external table if not exists test (

    name string

    )

    row format serde 'org.apache.hive.hcatalog.data.JsonSerDe'

    stored as textfile

    location 'hdfs://hacluster/user/hive/warehouse/database/table/jsondata';

  2. Failed to query the table.

NOTE:

This section applies to versions later than MRS 1.9.2.

Cause Analysis

When the default open-source serialized JSON statement is used to create a Hive table, damaged JSON data in the table cannot be filtered out. As a result, the query is abnormal.

Procedure

  1. Download json-serde-1.3.8-jar-with-dependencies.jar to the local host and upload the JAR file to all HiveServer nodes.
  2. Log in to the nodes where the JAR package is uploaded in 1 and the Hive and HDFS clients are installed as the client installation user.
  3. Run the following commands to authenticate the user:

    cd Client installation directory

    source bigdata_env

    kinit User who has the Hive administrator rights (Skip this operation for clusters with Kerberos authentication disabled)

  4. Run the following command to create an HDFS directory for storing JAR files:

    hdfs dfs -mkdir HDFS directory for storing JAR files

  5. Run the following command to upload the JAR files in 2 to HDFS:

    hdfs dfs -put JAR file storage path HDFS directory for storing JAR files

  6. Run the following commands to enable Hive to load a specified JAR file when executing a CLI task:

    beeline

    set role admin; (Skip this step for clusters with Kerberos authentication disabled)

    add jar HDFS directory for storing JAR files

  7. Run the following commands to create the table again:

    create external table if not exists test (

    name string

    )

    row format serde 'org.openx.data.jsonserde.JsonSerDe'

    stored as textfile

    location 'hdfs://hacluster/user/hive/warehouse/database/table/jsondata';

  8. Run the following command to modify the table property to ignore damaged JSON data:

    ALTER TABLE test SET SERDEPROPERTIES( "ignore.malformed.json" = "true");

    After this property is modified, NULL is displayed by default if the queried table contains damaged JSON data.

  9. Run the following command to query table data:

    select * from test;

    If the data query is successful, the damaged JSON data is ignored. The damaged JSON data is displayed as NULL.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback