-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3331 from EnterpriseDB/content/docs/mongo_data_ad…
…apter/new_release FDW - Release branch
- Loading branch information
Showing
21 changed files
with
631 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
product_docs/docs/hadoop_data_adapter/2/10c_example_order_by_pushdown.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: "Example: ORDER BY pushdown " | ||
--- | ||
|
||
This example shows ORDER BY pushdown between the foreign tables of the same remote HIVE/SPARK server as the remote HIVE/SPARK server: | ||
|
||
Tables on HIVE/SPARK server: | ||
|
||
```sql | ||
0: jdbc:hive2://localhost:10000> describe emp; | ||
+-----------+------------+----------+--+ | ||
| col_name | data_type | comment | | ||
+-----------+------------+----------+--+ | ||
| empno | int | NULL | | ||
| ename | string | NULL | | ||
| job | string | NULL | | ||
| mgr | int | NULL | | ||
| hiredate | date | NULL | | ||
| sal | int | NULL | | ||
| comm | int | NULL | | ||
| deptno | int | NULL | | ||
+-----------+------------+----------+--+ | ||
8 rows selected (0.747 seconds) | ||
0: jdbc:hive2://localhost:10000> describe dept; | ||
+-----------+------------+----------+--+ | ||
| col_name | data_type | comment | | ||
+-----------+------------+----------+--+ | ||
| deptno | int | NULL | | ||
| dname | string | NULL | | ||
| loc | string | NULL | | ||
+-----------+------------+----------+--+ | ||
3 rows selected (0.067 seconds) | ||
``` | ||
|
||
Tables on Postgres server: | ||
|
||
```sql | ||
-- load extension first time after install | ||
CREATE EXTENSION hdfs_fdw; | ||
|
||
-- create server object | ||
CREATE SERVER hdfs_server FOREIGN DATA WRAPPER hdfs_fdw OPTIONS(host 'localhost', port '10000', client_type 'spark', auth_type 'LDAP'); | ||
|
||
-- create user mapping | ||
CREATE USER MAPPING FOR public SERVER hdfs_server OPTIONS (username 'user1', password 'pwd123'); | ||
|
||
-- create foreign table | ||
CREATE FOREIGN TABLE emp ( | ||
empno INTEGER, | ||
ename VARCHAR(10), | ||
job VARCHAR(9), | ||
mgr INTEGER, | ||
hiredate DATE, | ||
sal INTEGER, | ||
comm INTEGER, | ||
deptno INTEGER | ||
) | ||
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp'); | ||
``` | ||
|
||
Query with ORDER BY pushdown: | ||
|
||
```sql | ||
edb=# SET hdfs_fdw.enable_order_by_pushdown TO ON; | ||
SET | ||
edb=# EXPLAIN (COSTS OFF) SELECT * FROM emp order by deptno; | ||
__OUTPUT__ | ||
QUERY PLAN | ||
--------------------- | ||
Foreign Scan on emp | ||
(1 row) | ||
|
||
edb=# SET hdfs_fdw.enable_order_by_pushdown TO OFF; | ||
SET | ||
edb=# EXPLAIN (COSTS OFF) SELECT * FROM emp order by deptno; | ||
__OUTPUT__ | ||
QUERY PLAN | ||
--------------------------- | ||
Sort | ||
Sort Key: deptno | ||
-> Foreign Scan on emp | ||
(3 rows) | ||
``` |
Oops, something went wrong.
f89ac24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://edb-docs-staging.netlify.app as production
🚀 Deployed on https://63b80cd2947e7e35e23bff75--edb-docs-staging.netlify.app