Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Hive query for column matching

Shulou Source: shulou.com Published: 2022-06-03 05:38:35 11月24日 Update

This document records the use of hive column wildcard query. Usually, when writing hql, we often use wildcard in where filtering conditions. In fact, regular wildcard can also be used for column alignment in hive when select.

Usage scenario: there are many columns in the table and there are regular names (col1_a,col1_b,col2_z,col2_d,col10_w …) It is troublesome to check the data to list all the columns (lazy mode).

Select `col\ d+ `from table-- finds all the columns of "col" + numbers, such as col1,col23,col100

Tags: Time query name scene lazy person number data condition pattern rule rule trouble Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Huawei Redmi macOS Docker