/syncsort-dtl

Files related to Syncsort DTL data flow language

Primary LanguageEmacs Lisp

Overview

This project is for files related to Syncsort DTL data flow language

  • emacs/dtl-mode – contains the major mode for Syncsort DTL. demo video
  • emacs/snippets – various useful snippets for use with yasnippet

Files

dtl-projects

Example DTL projects showing various ETL processes. Separate README in that directory.

Emacs DTL Mode emacs/dtl-mode/dtl-mode.el

Files

  • emacs/dtl-mode/dtl-mode.el: Emacs dtl-mode
  • emacs/dtl-mode/dtl-mode.dict: dictionary of commands and keywords for DTL for use with and auto-completion package

Mode capabilities

This mode provides syntax highlighting for DTL commands, keywords, task types, and environment variables. It implements automatic indentation. It allows the user to run the current job or task, and uses the compilation buffer to navigate errors and warnings.

Run jobs in a compilation buffer

In order to make use of the compilation buffer for running DTL jobs and tasks, you should make a file envvars.sh executable bash script in your project directory for any environment variables your DTL code makes use of.

Example envvars.sh (env vars should be exported in the script)

#!/bin/bash
export HDFS_SERVER=`hostname`
export SRCDIR=/apache2

When you want to run the job or task, type C-c C-c

emacs/dtl-mode/dtl-mode.dict

A dictionary of commands, keywords and functions to use with the auto-complete package.

To use this, place something like the following in your init file:

(add-hook 'dtl-mode-hook 
          (lambda ()
            (when (and 
                   (boundp 'dtl-ac-dict-file) 
                   (file-exists-p dtl-ac-dict-file) 
                   (require 'auto-complete nil t))
              (add-to-list 'ac-dictionary-files dtl-ac-dict-file)
              (ac-config-default)
              (auto-complete-mode 1))))

emacs/snippets

The emacs/snippets directory contains several snippets for use with the yasnippet.el package.

To enable the snippets, add the emacs/snippets directory to one of your snippets locations, then add the following to your init file:

(add-hook 'dtl-mode-hook
          lambda()
          (when (require 'yasnippet nil t)
            (yas-minor-mode 1)))

VIM syntax highlighting

Files: vim/syntax/dtl.vim

To setup and automatically load syntax hilighting for *.dtl files, copy this file into ~./vim/syntax

Add the lines below to ~/.vimrc

syntax enable
autocmd BufRead,BufNewFile *.dtl set filetype=dtl

Notepad++ syntax highlighting

Files: npp/dtl.xml

For Notepad++ on Windows. Import dtl.xml using Language -> Define your language -> Import

Future enhancements

  • I welcome contributions, please send me a message if you would like to help.