Is there a way to view list of tables and columns in hue - impala

I'm trying to get a list of tables and their columns using Hive/Impala. I know I can use Show Tables to get a table list but is there a way i can also view their columns as well in the same result set?

Related

Mapping a query with different column names (sometimes in a different language) to a table in a different server

What is the best tool or method to map a SQL Server query to a SQL Server table with different column names?
Secondly and separately, is there a tool that considers objects and values in a different language. I attempted to use Redgate; however, the SQL Compare function does not allow for mapping with different column names.
Mapping is needed for different queries from different agencies who each use different table/column names. In some cases, the language for the columns and values are different (i.e., Italian, Spanish).
SQL Data Compare (not SQL Compare) lets you compare a table against a view. So If you create a view on the second table, giving it the column names used in the first table, then you can use the Tables and Views tab to map the table with the view.
Make sure you "include views" in the Options tab to see the views listed in the tables and views tab.

Pentaho merge two tables

I'm new to Pentaho.
This is the transformation I'm trying to do:
Import Transactions and Merchant and merge these two tables using MERCH_KEY
However, this isn't working, see below:
This is table Transactions:
And this is table Merchant:
And this is the Merge join:
This all seems good, but it's not working and I have no idea why.
From the preview, I can see the two tables are being imported, so how can I merge them?
Remove all fields except "MERCH_KEY" from the right-side list.
The Merge join step is a little misleading with its behavior, as it only allows you to click Get Fields and get ALL fields, but doesn't let you pick a single field in a dropdown.
As the name suggest, these are the key fields that will be compared in the join, so fields need to be in the correct order. In your case, you only need the one. The other input fields (from both tables) will be automatically added to the output stream, with fields from the second table getting renamed if duplicated.

Pentaho dynamic merge key fields

I am trying to perform a merge in Kettle Pentaho. One table will be merged with exactly the same table on another database. The table name to be merged will be passed as an argument so I will have a config table in my db that will contain the column(s) on which the 2 instances of the table have to be joined on.
My question is, can I do a merge with dynamic key fields? I could have a separate step/transformation that selects the names of the columns to be used as keys from the config table.
Thanks in advance!
Better to do the merge with static fields, but use separate steps to populate those fields dynamically with the values you want to merge by. Remember to sort after you populate the fields!

Count Customers in a column

I have a table that has 1K rows. In the table there is a column that has the names of the customers. I need to add a column that counts (index) how many customers I have.
Doing a calculated measure using the distinctcount formula I get 3156 customers. My goal is to accomplish the same result of the calculated field in a calculated column.
Thanks for the help.
Not sure about a calculated column but one way you can accomplish this is to make related dCustomers dimension table from your source. You question didn't happen to mention your source - here is how I'd do it for the most common sources in my estimation:
SQL database connection:
SELECT DISTINCT customerField
FROM yourViewOrTable
Excel/Text File:
Duplicate the worksheet with the Linked Table.
On the worksheet copy delete all columns except the Customers column.
With the a single cell active in the data go to Data>Remove Duplicates.
Under the PowerPivot ribbon tab click Create Linked Table.
Now What?
You should now have two tables from whatever source you are using. You'll find your new table has 3156 records in it. Go to Diagram view and drag a relationship from table1.CustomerField to table2.CustomerField.
With the relationship made you should be able to do anything you need to do, but please fire back if you have any questions on your use case.

SQL Reporting Service - Data Model

I create a data model that would replace two cut down tables. With these two table I placed a Many to One relationships.
When I create reports that just uses a single table (This is the Destination table, within Data source views relationship) its missing records that should be displayed. The records that do not display are records that do no have a linked record in the other table.
Help
You probably need to create a query or a view that includes an outer join. Search your docs for OUTER JOIN. That should take you where you need to be. Topics should include LEFT, RIGHT, and FULL outer joins.