Skip to content
Advertisement

Is it possible to choose to select from which database in Hive

I have one table but in two different databases. How can I query to based on some flag to select only from one of them?

For example:

What’s the corresponding query (that works) to this sudo query?

Advertisement

Answer

You can pass database parameter using shell

You can do similar in Hive using UNION ALL, though it is not efficient way:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement