Categories

版本

Using the Tableau Table Writer

TheTableau Table Writerextension allows for exporting data as.tde or .hyper Tableau extract filesdirectly from RapidMiner Studio. It also lets you upload your.tdeor.hyperfile to a Tableau Server. The document will walk you through the installation and usage of these functionalities.

The extension runs on Windows (64 bit), Mac OS X (64 bit) and Linux distributions (64 bit).

Install the Tableau Table Writer extension

To use the Tableau Table Writer extension you need to first install either:

Note that Tableau SDK creates.tdeextract files, Tableau Data Extract writes into the new.hyperformat. There is no way to change from one format to the other without changing the setup and restarting RapidMiner Studio or Server.

Download the appropriate API (C/C++/Java 64 bit version) from the official Tableau website (see links above) and follow the instructions below for Windows, Mac OS or Linux depending on the target platform. Note that the extension also supports thedeprecatedTableau Extract APIfor backward compatibility, but it is no longer recommended.

  1. SDK / API提供一个s ZIP archive. Extract all contents of the archive to your hard drive, e.g., to a folder under yourProgram Filesfolder. We will use the folder nameTableau Data Extract APIas an example.

  2. Open theAdvanced system settingsin Windows and click onEnvironment Variables.

  3. Add the location of the Data Extract API to your systemPathvariable inSystem variables, e.g., if you extracted the API toC:\Program Files\Tableau Data Extract API, add;C:\Program Files\Tableau Data Extract API\binto the end of the variable value (please note the semicolon at the beginning).

  4. Add a new entry to the用户变量andSystem variableslists as well calledTAB_SDK_TMPDIR. Specify a location where your user has write privileges, e.g.,C:\Users\\Documents, whereis your user name. If this folder is not specified and the default (e.g. RapidMiner Studio installation directory) cannot be written by your user, you may get an error sayingHyper Server did not start correctly.

  5. It is also recommended to addTAB_SDK_LOGDIRto the用户变量andSystem variableslists and set it to the same directory asTAB_SDK_TMPDIR点。数据提取operations are logged into a log file in the specified directory.

  1. SDK / API提供一个s image (.dmg) file. Open the .dmg file you downloaded.

  2. Drag all files in theFrameworksdirectory to/Library/Frameworks. You may be asked for your password.

  3. Specify environment variableTAB_SDK_TMPDIRto point to a location where your user has write privileges, e.g./tmp. The steps for doing this may depend on your OS X version, see an example below. If this folder is not specified and the default (e.g. RapidMiner Studio installation directory) cannot be written by your user, you may get an error sayingHyper Server did not call back on the callback port.

For OS X High Sierra, you can set an environment variable permanently by following these steps:

  1. 创建一个plistfile, e.g.,com.rapidminer.tableauTableWriter.plistunder~/Library/LaunchAgents/:

        Label com.rapidminer.tableauTableWriter ProgramArguments  sh -c launchctl setenv TAB_SDK_TMPDIR /tmp  RunAtLoad   
  2. Activate thisplistfile, so this changes are used immediately, not just after restart:

    launchctl load ~/Library/LaunchAgents/com.rapidminer.tableauTableWriter.plist launchctl start ~/Library/LaunchAgents/com.rapidminer.tableauTableWriter.plist

For older OS X versions,see this article.

  1. SDK / API提供一个s an archive file (you may use .deb or .rpm versions as well). Download it to e.g., your$HOME/tableaufolder.

  2. You can extract the files using the command line:tar xvf $HOME/tableau/*.tar.gz. This may extract a subdirectory with a name depending on the version, but we will ignore this subdirectoy for simplicity in the following steps when referring to a path. Make sure you check the path you are using.

  3. Add the location of the extractedbindirectory to your路径variable, e.g., if you extracted the API directly to$HOME/tableau, add$HOME/tableau/binto the variable.

  4. You may need to specify environment variableTAB_SDK_TMPDIRto point to a location where your user has write privileges, e.g./tmp. If this folder is not specified and the default (e.g. RapidMiner Studio installation directory) cannot be written by your user, you may get an error sayingHyper Server did not start correctly.

You need make sure that the Tableau libraries are loaded to the shared library cache when running the Tableau extension in RapidMiner Studio. Follow these steps to achieve that:

  1. 创建一个n empty file in theetc/ld.so.conf.ddirectory by issuing$ sudo touch /etc/ld.so.conf.d/tableau_lib.conf

  2. Edit the file and paste the absolute path of thetableausdklibraries. For example, following the$HOME/tableau/pattern above, paste$HOME/tableau/lib64/tableausdkinto the file.

  3. Update the library cache with the new libraries by issuing asudo ldconfig. To check if the libraries where indeed loaded, runsudo ldconfig -p | grep libTableauCommon.so

Alternatively, you may achieve the same with setting (temporarily or permanently) theLD_LIBRARY_PATHenvironment variable instead:

  1. SetLD_LIBRARY_PATHenvironment variable to the absolute path of thetableausdklibraries. For example, following the$HOME/tableau/pattern above, use$HOME/tableau/lib64/tableausdk.

Once the Tableau SDK / Data Extract API is properly installed you can proceed with the installation of the Tableau Table Write extension from the RapidMiner Marketplace:

Export data to Tableau's format

To export data as .tde or .hyper file from RapidMiner Studio, perform the following steps:

Select theWrite Tableau Extractoperator:

Import and select data file, e.g., from your Local Repository:

Connect the “out” port with the “inp” port:

Select a path for the output file (.tde or .hyper file extension depending on using SDK or Extract API 2.0, respectively):

Connect the “thr” port with the “res” port to see the result in the RapidMiner Studio:

Run your process to start the export!

Upload to Tableau Server

You can upload a .tde or .hyper data source to a Tableau Server using theUpload Tableau Data Sourceoperator provided by the extension. You'll need aTableau Serverconnection entry defined where you point to your target Tableau Server instance. Please follow the tooltips next to the fields on the connection editor dialog and test your connection.

Combine the two operators to directly upload a RapidMiner data source to a Tableau Server. First, convert the input data to the Tableau data format using aWrite Tableau Extractoperator, then, without specifying a local output path, simply connect the "fil" (file) output port directly to the "fil" input port of theUpload Tableau Data Source. This way, a local temporary file is used for the transformation and it is automatically deleted from your local disk once the process completes. In the example shown below, the upload operator receives the Tableau Server connection on its "con" input port, but you can also use the operator's connection entry parameter instead.