Initial configuration v2
Before creating the extension and the database objects that use the extension, you must modify the Postgres host, providing the location of the supporting libraries.
After installing Postgres, modify postgresql.conf
, located in:
/var/lib/edb/as_version/data
Modify the configuration file, adding the hdfs_fdw.jvmpath
parameter to the end of the configuration file and setting the value to specify the location of the Java virtual machine (libjvm.so
). Set the value of hdfs_fdw.classpath
to indicate the location of the Java class files used by the adapter. Use a colon (:) as a delimiter between each path. For example:
Note
Copy the jar files (hive-jdbc-1.0.1-standalone.jar
and hadoop-common-2.6.4.jar
) from the respective Hive and Hadoop sources or website to the PostgreSQL instance where Hadoop Foreign Data Wrapper is installed.
If you're using EDB Postgres Advanced Server and have a DATE
column in your database, you must set edb_redwood_date = OFF
in the postgresql.conf
file.
After setting the parameter values, restart the Postgres server. For detailed information about controlling the service on an EDB Postgres Advanced Server host, see the EDB Postgres Advanced Server documentation.
Before using the Hadoop Foreign Data Wrapper:
- Use the CREATE EXTENSION command to create the extension on the Postgres host.
- Use the CREATE SERVER command to define a connection to the Hadoop file system.
- Use the CREATE USER MAPPING command to define a mapping that associates a Postgres role with the server.
- Use the CREATE FOREIGN TABLE command to define a table in the EDB Postgres Advanced Server database that corresponds to a database that resides on the Hadoop cluster.
CREATE EXTENSION
Use the CREATE EXTENSION
command to create the hdfs_fdw
extension. To invoke the command, use your client of choice (for example, psql) to connect to the Postgres database from which you will be querying the Hive or Spark server, and invoke the command: