Yanting Lin
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Oracle ETL at MIS DB & build test fail issue 以下說明是基於Morris跟幾摳的突破往下切入 ### 1. Parse MIS 資料庫狀況說明 *需確認目標資料庫的網路環境,通常需為內網 把ORACLE_METADATA_ETL.job template 修改好後,下列方式擇一: 1. 放至 WhereHows/wherehows-backend/jobs,再 docker build 2. 複製job檔案至 backend容器的 **/application/jobs/** 目錄 ``` docker cp ORACLE_METADATA_ETL.job wherehowsdocker_wherehows-backend_1:/application/jobs/ ``` 目前使用try catch可以跳過library無法處理的data(尤其中文) 也對資料庫來的data做了一些unicode encode,但還是有些資料會有問題 但Web端會有可以看的dataset metadata 目前修改OracleExtract.py的 [writer.writerow(data)](https://goo.gl/f6qUFr),僅供參考如下 (修改後請記得rebuild) ```python def write_csv(self, csv_filename, csv_columns, data_list): csvfile = open(csv_filename, 'wb') os.chmod(csv_filename, 0644) writer = csv.DictWriter(csvfile, fieldnames=csv_columns, delimiter='\x1A', lineterminator='\n', quoting=csv.QUOTE_NONE, quotechar='\1', escapechar='\0') writer.writeheader() for data in data_list: try: if isinstance(data, unicode): writer.writerow(data.encode('utf-8')) elif isinstance(data, dict): if isinstance(data['name'], unicode): data['name'] = data['name'].encode('utf-8') writer.writerow(data) else : writer.writerow(data) except : print "[DEBUG] The problem data is " + str(data) + "\n Type is :" + str(type(data)) csvfile.close() ``` ::: warning 修改時請用空白鍵做排版,如果空白鍵混搭 tab,runtime 會出錯: ERROR w.c.j.Launcher:87 - IndentationError: ('unindent does not match any outer indentation level', ...) ::: 尚未釐清的問題有:   (1). 無法顯示Sample Data   (2). 無法搜尋Dataset   (3). 還是有些資料沒有成功encode而有error 另外,宗哲也發現Data lineage wherehows尚未實作 所以在Data Lineage頁面只看到一個節點是可以預期的 For (2),需給 frontend [search template](https://github.com/linkedin/WhereHows/tree/master/wherehows-data-model/ELASTICSEARCH)、新增 backend job,且需確認許多額外初始化、參數與檔案位置 (有必要詳情請找宗哲) ex: 由於過程中要生成檔案 /var/tmp/wherehows/resource/dataset.json,所以需要開資料夾以及設定權限,以 docker 為例,修改 [wherehows-docker 的 backend Dockerfile](https://github.com/linkedin/WhereHows/blob/master/wherehows-docker/wherehows-backend/Dockerfile),新增以下指令 (by 小林): ```python RUN mkdir /var/tmp/wherehows RUN chmod a+rw /var/tmp/wherehows RUN mkdir /var/tmp/wherehows/resource ``` 大致概念:目前用 ORACLE_METADATA_ETL.job trigger rebuild (加入此行 rebuild.tree.dataset=true),跑 DATASET_TREE_BUILDER.job (將 ELASTIC_SEARCH_ETL.job 的參數放過去) 並修改 [DatasetTreeBuilder.py](https://github.com/linkedin/WhereHows/blob/master/wherehows-etl/src/main/resources/jython/DatasetTreeBuilder.py#L90) 的 update_dataset(...) 為 run() 強迫初始化 search 的 index) 理論上或許單獨跑 ORACLE_METADATA_ETL.job 以及 ELASTIC_SEARCH_ETL.job 即可,未必要用 DATASET_TREE_BUILDER.job --- ### 2. Build test fail的原因 (1). 幾摳發現沒有設定JAVA_HOME環境變數給測試檔讀取 (2). 以及要清除之前因為build test fail產生的temp***.job 檔案 #### macOS Solution 1. `./gradlew build` Failed message![](https://i.imgur.com/U3r42mu.png) 2. 找到os上的java home路徑 輸入 `/usr/libexec/java_home -v 1.8` 並將路徑設為**JAVA_HOME**的環境變數 ![](https://i.imgur.com/B3oHKL3.png) 3. 在未清除因build失敗產生的暫存job時,依然會顯示錯誤 ![](https://i.imgur.com/mGsce38.png) 4. 在JobsUtilTest.java 有問題的function擇一 (e.g., testGetEnabledJobs) 加下列兩行找檔案路徑 ```java System.out.println("Filename 1 is " + filename1); System.out.println("Dir is : " + dir); ``` 此外,在wherehows-common/build.gradle的test block改成如下 ```build test { // enable TestNG support (default is JUnit) useTestNG() testLogging.showStandardStreams = true // add this } ``` * 若已知檔案的部分名稱,也可用grep找比較快 5. 從Error Report找到temp job 檔案路徑,到該目錄下列出所有檔案 例如 `var/folders/76sqx3gn7ms3v1sg3yzvjtsm0000gn/T/` ![](https://i.imgur.com/MBOyOmM.png) 會看到許多temp***.job這也解釋了為什麼越build檔案越多 因為他fail之後就中斷沒有清除檔案,感覺是他們沒寫好 之後輸入 `rm temp*.job`,到根目錄輸入`./gradlew build`指令即可 #### Windows 7 solution ::: warning 1. 設定環境變數,新增系統變數 JAVA_HOME 路徑 C:\Program Files\Java\jdk1.8.0_111 2. Windows 7 的temp*.job檔案目錄在 ****C:\Users\USERNAME\AppData\Local\Temp**** 3. 移除所有的 temp***.job 4. 尚需解決Windows特有的[Hadoop環境變數](https://hackmd.io/KYVgzGAsBGAmwFoDGBDEIGRUsCAcSW+AjLGMYdgOyTFA?both#設定環境變數)問題 5. 完成上述步驟後,在根目錄下 `./gradlew build` 即可 ::: 以上資訊,希望對大家開發Wherehows能有一點幫助~

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully