Forum Discussion
SAP HANA source tables not found using the SAP HANA database connector
- 8 months ago
Regarding this:
There is currently no supported option in Fabric to force Dataflow Gen2 to enumerate raw SAP HANA tablesOne way to query raw SAP HANA tables within a Dataflow Gen 2 is to use the SAP HANA Power Query connector support for native queries. Simply create a native query that can be as simple as "select * from table", and make sure EnableFolding is set to true. Then you can apply operators from the Power Query UX and most will "fold" to the HANA database. It supports parameterized queries (even when EnableFolding is true), as documented here:
https://learn.microsoft.com/en-us/power-query/connectors/sap-hana/overview#native-query-support-in-the-sap-hana-database-connector
Using this approach, you could even join two tables and the join will fold, just keep a look at the query folding indicators to make sure the operations are getting folded.
For example:let SalesNativeQuery = Value.NativeQuery( SapHana.Database(":", [Implementation = "2.0"]), "select ""MAKE"", ""MODEL"", ""CITY"" from ""AN_SALES"" where ""GENDER"" = ? and ""MODEL"" = ?", {"F", "Carretera"}, [EnableFolding = true] ), ProductNativeQuery = Value.NativeQuery( SapHana.Database(":", [Implementation = "2.0"]), "select ""MAKE"", ""PRODUCT_LINE"", ""CATEGORY"" from ""PRODUCT_CATALOG"" where ""CATEGORY"" = ?", {"Bikes"}, [EnableFolding = true] ), Merge = Table.NestedJoin( SalesNativeQuery, {"MAKE"}, ProductNativeQuery, {"MAKE"}, "Product", JoinKind.LeftOuter ), #"Expanded Product" = Table.ExpandTableColumn( Merge, "Product", {"PRODUCT_LINE", "CATEGORY"}, {"Product.PRODUCT_LINE", "Product.CATEGORY"} ) in #"Expanded Product"
Regarding this:
There is currently no supported option in Fabric to force Dataflow Gen2 to enumerate raw SAP HANA tables
One way to query raw SAP HANA tables within a Dataflow Gen 2 is to use the SAP HANA Power Query connector support for native queries. Simply create a native query that can be as simple as "select * from table", and make sure EnableFolding is set to true. Then you can apply operators from the Power Query UX and most will "fold" to the HANA database. It supports parameterized queries (even when EnableFolding is true), as documented here:
https://learn.microsoft.com/en-us/power-query/connectors/sap-hana/overview#native-query-support-in-the-sap-hana-database-connector
Using this approach, you could even join two tables and the join will fold, just keep a look at the query folding indicators to make sure the operations are getting folded.
For example:
let
SalesNativeQuery =
Value.NativeQuery(
SapHana.Database(":", [Implementation = "2.0"]),
"select ""MAKE"", ""MODEL"", ""CITY"" from ""AN_SALES"" where ""GENDER"" = ? and ""MODEL"" = ?",
{"F", "Carretera"},
[EnableFolding = true]
),
ProductNativeQuery =
Value.NativeQuery(
SapHana.Database(":", [Implementation = "2.0"]),
"select ""MAKE"", ""PRODUCT_LINE"", ""CATEGORY"" from ""PRODUCT_CATALOG"" where ""CATEGORY"" = ?",
{"Bikes"},
[EnableFolding = true]
),
Merge =
Table.NestedJoin(
SalesNativeQuery, {"MAKE"},
ProductNativeQuery, {"MAKE"},
"Product",
JoinKind.LeftOuter
),
#"Expanded Product" =
Table.ExpandTableColumn(
Merge,
"Product",
{"PRODUCT_LINE", "CATEGORY"},
{"Product.PRODUCT_LINE", "Product.CATEGORY"}
)
in
#"Expanded Product"