Creating multiple rows from single row on specified conditions in hive

Manish Vishnoi

I am trying to implement Null check. For e.g :

Col_A | Col_B | Col_C | Col_D
null  | boy   | null  | dust

Then I want output as :

Col_A | Col_B | Col_C | Col_D | New_Col
null  | boy   | null  | dust  | Col_A failed null check
null  | boy   | null  | dust  | Col_D failed null check

What is the proper way to do this ?

David דודו Markovitz
select t.*
      ,concat(elt(e.pos+1,'Col_A','Col_B','Col_C','Col_D'),' failed null check') as New_Col
from   mytable t lateral view posexplode (array(Col_A,Col_B,Col_C,Col_D)) e
where  e.val is null

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Multiple Rows of Data to Single Row by Conditions

From Dev

Not able to combine multiple rows into single row based on certain conditions

From Dev

Aggregate data from multiple rows into single row

From Dev

select single row from multiple rows by id

From Dev

combine data of multiple rows from multiple tables and show in single row

From Dev

How to select a single row where multiple rows exist from a table

From Dev

How to create multiple rows from single row with time interval in MySQL

From Dev

Vectorized implementation to create multiple rows from a single row in pandas dataframe

From Dev

SQL Server - Display columns from multiple rows as single row

From Dev

How to get columns from multiple rows in a single row in SQL

From Dev

How to update a single row from multiple rows with UPDATE JOIN

From Dev

SQL Server - Display columns from multiple rows as single row

From Dev

How to combine values from multiple rows into a single row in Excel?

From Dev

How to combine values from multiple rows into a single row with a comma separator

From Dev

How to combine values from multiple rows into a single row using module?

From Dev

Insert multiple rows from a single row inside an insert into select query

From Dev

How to select a single row where multiple rows exist from a table

From Dev

Attempting to aggregate information from multiple rows into a single row

From Dev

How to get multiple rows from single row of table?

From Dev

Postgres Multiple Rows as Single Row

From Dev

Expand a single row into multiple rows

From Dev

Expand single row to multiple rows

From Dev

Single row to multiple columns and rows

From Dev

Paste into multiple rows and not a single row

From Dev

Creating a column with conditions over multiple rows

From Dev

Creating new column and rows based on multiple conditions

From Dev

Creating a column with conditions over multiple rows

From Dev

Split single row columns into multiple columns in Hive

From Dev

In SqlServer, how to join a single column from multiple rows into a single row with multiple columns

Related Related

  1. 1

    Multiple Rows of Data to Single Row by Conditions

  2. 2

    Not able to combine multiple rows into single row based on certain conditions

  3. 3

    Aggregate data from multiple rows into single row

  4. 4

    select single row from multiple rows by id

  5. 5

    combine data of multiple rows from multiple tables and show in single row

  6. 6

    How to select a single row where multiple rows exist from a table

  7. 7

    How to create multiple rows from single row with time interval in MySQL

  8. 8

    Vectorized implementation to create multiple rows from a single row in pandas dataframe

  9. 9

    SQL Server - Display columns from multiple rows as single row

  10. 10

    How to get columns from multiple rows in a single row in SQL

  11. 11

    How to update a single row from multiple rows with UPDATE JOIN

  12. 12

    SQL Server - Display columns from multiple rows as single row

  13. 13

    How to combine values from multiple rows into a single row in Excel?

  14. 14

    How to combine values from multiple rows into a single row with a comma separator

  15. 15

    How to combine values from multiple rows into a single row using module?

  16. 16

    Insert multiple rows from a single row inside an insert into select query

  17. 17

    How to select a single row where multiple rows exist from a table

  18. 18

    Attempting to aggregate information from multiple rows into a single row

  19. 19

    How to get multiple rows from single row of table?

  20. 20

    Postgres Multiple Rows as Single Row

  21. 21

    Expand a single row into multiple rows

  22. 22

    Expand single row to multiple rows

  23. 23

    Single row to multiple columns and rows

  24. 24

    Paste into multiple rows and not a single row

  25. 25

    Creating a column with conditions over multiple rows

  26. 26

    Creating new column and rows based on multiple conditions

  27. 27

    Creating a column with conditions over multiple rows

  28. 28

    Split single row columns into multiple columns in Hive

  29. 29

    In SqlServer, how to join a single column from multiple rows into a single row with multiple columns

HotTag

Archive