페이스북의 비디오 시청자의 85%는 소리를 줄여서 듣는다고 한다.

http://digiday.com/platforms/silent-world-facebook-video/


아티글의 내용에서 아래 두 동영상을 예로 들었는데, 소리 없어도 내용을 전달할 수 있도록 동영상에 글을 사용해서 메시지를 전달하는 구조를 가지고 있다.


https://www.facebook.com/NowThisNews/videos/vb.341163402640457/1063766647046792/?type=2&theater

https://www.facebook.com/techinsider/videos/vl.903537716400266/421792938019068/?type=1&theater



Posted by '김용환'
,

카산드라(Cassadra)라는 Nosql을 사실상 주도하는 DataStax가 2015년 아우렐리우스(https://github.com/thinkaurelius/titan)사의 그래프 DB(정확히 말하면 Titan)를 샀었다. 더 이상 아우렐리우스 그래프 DB를 관리하지 않고, 그 인력을 바탕으로 이번(2016.4)에 새로나온 Cassandra 엔터프라이즈 버전에 그래프 엔진을 추가했다.

가장 큰 특징은 그래프 DB 표준을 기반으로 한 것이라 한다.


https://tctechcrunch2011.files.wordpress.com/2016/04/datastax-studio.jpg?w=1316&h=782

http://www.datastax.com/products/datastax-enterprise-graph
http://techcrunch.com/2016/04/12/datastax-adds-graph-databases-to-enterprise-cassandra-product-set/
http://www.ciokorea.com/print/29328

Posted by '김용환'
,


pv 라는 파이프 뷰 프로그램이 있다. 얼마나 진행되는지 보여준다.

rpm 커맨드는 좀 더 상세하게 rpm 패키지가 어떻게 설치되었는지 정보를 확인할 수 있다.




$ pv a.out > /dev/null

8.46kiB 0:00:00 [10.8MiB/s] [========================================================================================================>] 100%


pv를 rpm으로 설치할 수 있다.




설치 


$ curl -O http://dl.fedoraproject.org/pub/epel/7/x86_64/p/pv-1.4.6-1.el7.x86_64.rpm

$ rpm -Uvh ~/pv-1.4.6-1.el7.x86_64.rpm




설치 확인


$ rpm -qa | grep "pv-"

pv-1.4.6-1.el7.x86_64




테스트 

$ dd if=/dev/urandom | pv | dd of=/dev/null



-qi는 정보 확인

$ rpm -qi pv

Name        : pv

Version     : 1.4.6

Release     : 1.el7

Architecture: x86_64

Install Date:

Group       : Development/Tools

Size        : 95481

License     : Artistic 2.0

Signature   : RSA/SHA256, 2014년 02월 05일 (수) 오후 01시 54분 31초, Key ID 6a2faea2352c64e5

Source RPM  : pv-1.4.6-1.el7.src.rpm

Build Date  :

Build Host  : buildvm-14.phx2.fedoraproject.org

Relocations : (not relocatable)

Packager    : Fedora Project

Vendor      : Fedora Project

URL         : http://www.ivarch.com/programs/pv.shtml

Summary     : A tool for monitoring the progress of data through a pipeline

Description :

PV ("Pipe Viewer") is a tool for monitoring the progress of data through a

pipeline.  It can be inserted into any normal pipeline between two processes

to give a visual indication of how quickly data is passing through, how long

it has taken, how near to completion it is, and an estimate of how long it

will be until completion.





설치된 디렉토리/파일 목록 확인

$ rpm -ql pv

/usr/bin/pv

/usr/share/doc/pv-1.4.6

/usr/share/doc/pv-1.4.6/COPYING

/usr/share/doc/pv-1.4.6/NEWS

/usr/share/doc/pv-1.4.6/README

/usr/share/doc/pv-1.4.6/TODO

/usr/share/locale/de/LC_MESSAGES/pv.mo

/usr/share/locale/fr/LC_MESSAGES/pv.mo

/usr/share/locale/pl/LC_MESSAGES/pv.mo

/usr/share/locale/pt/LC_MESSAGES/pv.mo

/usr/share/man/man1/pv.1.gz




설치된 디렉토리 확인

$ rpm -qd pv

/usr/share/doc/pv-1.4.6/COPYING

/usr/share/doc/pv-1.4.6/NEWS

/usr/share/doc/pv-1.4.6/README

/usr/share/doc/pv-1.4.6/TODO

/usr/share/man/man1/pv.1.gz




'unix and linux' 카테고리의 다른 글

ipcalc - ip 계산기  (0) 2016.06.14
sudo echo > 에러 대신 tee 커맨드  (0) 2016.06.07
[python] carriage return 이슈  (0) 2016.05.27
dstat 툴  (0) 2016.05.23
[centos7] systemctl 맛보기  (0) 2016.05.11
Posted by '김용환'
,



play 1.3.1은 carriage return 이슈가 있다. 


play를 실행하면, python 실행시 \r이 붙어 에러가 발생하고 실행이 되지 않는다.


/usr/local/play $ ./play

env: python\r: No such file or directory



carriage return이 있는지 간단하게 vi play 로 볼 수 있도 있지만, od 명령어를 사용하면, \r\n으로 release 한 것을 확인할 수 있다. 


$ cat play | od -c
0000000    #   !   /   u   s   r   /   b   i   n   /   e   n   v       p
0000020    y   t   h   o   n  \r  \n   #       ~   ~   ~   ~   ~   ~   ~
0000040    ~   ~   ~   ~   ~   ~   ~   ~   ~   ~   ~   ~   ~   ~   ~   ~


이 문제를 해결하려면, tr 명령어를 사용하여 \r를 모두 없앨 수 있다.


$ tr -d '\r' < play



$ play

동작..

'unix and linux' 카테고리의 다른 글

sudo echo > 에러 대신 tee 커맨드  (0) 2016.06.07
[pv] rpm으로 파이프 뷰 프로그램 설치 및 실행  (0) 2016.05.27
dstat 툴  (0) 2016.05.23
[centos7] systemctl 맛보기  (0) 2016.05.11
[centos 7] realpath 명령어  (0) 2016.05.03
Posted by '김용환'
,

1.3.0에서 1.3.4 또는 1.4.2로 버전업할 때 유의사항을 소개한다.



play1 framework가 잠깐 중지되었다가 다시 진행되어 개발되고 있다.

특별히 API는 거의 바뀌지는 않고, 의존 library 버전 업 또는 elastic한 코드 유지보수 정도로 진행되고 있다.




play1 framework를 1.3.0에서 1.3.4 또는 1.4.2로 버전 업할 때, 기존에 쓰던 netty 버전이 이슈가 될 수 있다.

play1 1.3.4 또는 1.4.2는 netty 3.9.8 final 버전을 사용하고 있다.


특히 PlayHandler.java에서 netty 3.9.7부터 소개된 org.jboss.netty.handler.codec.http.cookie.ServerCookieEncoder 때문이라도 3.9.7 이전 버전을 쓸 수 없다. 


https://github.com/playframework/play1/blob/master/framework/src/play/server/PlayHandler.java#L412


nettyResponse.headers().add(SET_COOKIE, ServerCookieEncoder.STRICT.encode(c));





만약 그 이하의 버전의 netty를 사용할 때는 500 에러와 함께 internal error (check logs)만 보게 될 것이다.


(문제를 해결하기 위해 play 소스의 PlayHandler.java를 수정하면서 진행하니. 해당 코드의 Unexpected Error만 출력되는 것을 확인할 수 있었다. 그래서 더 깊이 보니. ClassNotFoundException같은 류로 여겨진다.)



-> 따라서 기존의 웹 애플리케이션 서버의 netty 버전을 3.9.8 final로 쓰면 간단히 문제는 해결된다.






*play1의 단점

Play1 framework의 PlayHandler.java 코드를 살펴보면, Exception 처리가 잘 안되어 있다. 따라서 문제가 생겼을 때 아무것도 못할 수 있는데, 이때는 framework/src 디렉토리 밑의 소스를 수정하고 ant 빌드하면서 play 코드를 실행할 수 있다. (play1 framework는 Exception 기반의 framework라....)





* dependency lib 이슈

play 애플리케이션이 play/framework/lib/asm-all-5.1.jar 대신 asm-all-4.1.0.jar를 써야 동작되는 이슈가 있었다.

관련해서 lib를 교체하고 사설 jar를 만들어 배포해서 실행토록 진행했다.

Posted by '김용환'
,

dstat 툴

unix and linux 2016. 5. 23. 16:32



최근에 본 툴 중 마음에 드는 툴이다. 거의 모든 시스템 정보를  줄 단위로 볼 수 있다.


$yum install dstat


$ dstat --time --cpu --net --disk --sys --load --proc --top-cpu --mem --swap --tcp --udp



Posted by '김용환'
,


자바에 primtive 타입에서 클래스 타입이 들어오면서 (int->Integer, boolean ->Boolean등)

좋아지는 부분도 있지만, 개발자들이 실수하는 코드도 있다.


특히 자바가 아닌 다른 언어에서는 자동으로 지원하지만, 자바는 되지 않는 것들이 바로 이런 경우일 것이다.





자바에서는 boolean 값에 null을 넣을 수 없다. (type mismatch)


boolean a = null;





하지만 아래 boolean과 Boolean을 동시에 사용하면, Boolean으로 변환(autoboxing)이 된다. 


다른 언어에서처럼 null에 대해서는 특별히 처리가 안되는 부분이 있다.




코드


@Test

public void test() {

boolean debug = isDebug();

System.out.println(debug);

}


public Boolean isDebug() {

return null;

}




결과

메소드의 리턴 결과에 Boolean 변수를  null을 리턴하면, NPE가 발생한다.

자바에 익숙치 않은 다른 언어 개발자는 null 을 사용하는 경향이 있는 것은

    if 문이 숫자 또는 null 에 대한 처리를 하기 때문인 듯하다. 



java language spec에 따르면, if문은 반드시 boolean이나 Boolean 이어야 한다.



https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.9

14.9. The if Statement

The if statement allows conditional execution of a statement or a conditional choice of two statements, executing one or the other but not both.

IfThenStatement:
IfThenElseStatement:
IfThenElseStatementNoShortIf:

The Expression must have type boolean or Boolean, or a compile-time error occurs.

Posted by '김용환'
,

<systemctl로 서비스 예제>


먼저 httpd를 설치한다.

$ sudo yum install httpd
(참고로 예시로 사용할 crond는 이미 설치되어 있고 실행중인 데몬이다.)


systemctl 데몬 관련 커맨드

* systemctl start : 데몬 시작
* systemctl stop : 데몬 종료
* systemctl restart : 데몬 재시작
* systemctl reload : 데몬 reload (예, apache graceful )
* systemctl status : 데몬 상태 확인
* systemctl enable : 활성화 - 부팅 이후에도 계속 데몬을 실행할지 
* systemctl disable : 활성화 - 부팅 이후에도 계속 데몬을 실행안하도록
* systemctl is-enabled : 활성화인지 확인한다.
* systemctl is-active : 동작 중인지 확인한다.



예시

$ sudo systemctl start httpd.service

$ sudo systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
   Active: active (running) since 수 2016-05-11 17:58:17 KST; 4s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 11784 (httpd)
   Status: "Processing requests..."
   CGroup: /system.slice/httpd.service
           ├─11784 /usr/sbin/httpd -DFOREGROUND
           ├─11785 /usr/sbin/httpd -DFOREGROUND
           ├─11786 /usr/sbin/httpd -DFOREGROUND
           ├─11788 /usr/sbin/httpd -DFOREGROUND
           ├─11791 /usr/sbin/httpd -DFOREGROUND
           └─11792 /usr/sbin/httpd -DFOREGROUND

$ sudo systemctl enable httpd.service
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
$ sudo systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: active (running) since 수 2016-05-11 17:58:17 KST; 21s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 11784 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─11784 /usr/sbin/httpd -DFOREGROUND
           ├─11785 /usr/sbin/httpd -DFOREGROUND
           ├─11786 /usr/sbin/httpd -DFOREGROUND
           ├─11788 /usr/sbin/httpd -DFOREGROUND
           ├─11791 /usr/sbin/httpd -DFOREGROUND
           └─11792 /usr/sbin/httpd -DFOREGROUND

$ sudo systemctl restart httpd.service
$ sudo systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: active (running) since 수 2016-05-11 17:58:53 KST; 2s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 11831 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
 Main PID: 11836 (httpd)
   Status: "Processing requests..."
   CGroup: /system.slice/httpd.service
           ├─11836 /usr/sbin/httpd -DFOREGROUND
           ├─11837 /usr/sbin/httpd -DFOREGROUND
           ├─11838 /usr/sbin/httpd -DFOREGROUND
           ├─11839 /usr/sbin/httpd -DFOREGROUND
           ├─11840 /usr/sbin/httpd -DFOREGROUND
           └─11843 /usr/sbin/httpd -DFOREGROUND

$ sudo systemctl reload httpd.service
$ sudo systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: active (running) since 수 2016-05-11 17:58:53 KST; 20s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 11831 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 11859 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 11836 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─11836 /usr/sbin/httpd -DFOREGROUND
           ├─11860 /usr/sbin/httpd -DFOREGROUND
           ├─11861 /usr/sbin/httpd -DFOREGROUND
           ├─11862 /usr/sbin/httpd -DFOREGROUND
           ├─11863 /usr/sbin/httpd -DFOREGROUND
           └─11864 /usr/sbin/httpd -DFOREGROUND

$ sudo systemctl stop httpd.service
$ sudo systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: inactive (dead) since 수 2016-05-11 17:59:22 KST; 1s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 11883 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 11859 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
  Process: 11836 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)
 Main PID: 11836 (code=exited, status=0/SUCCESS)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"

$ sudo systemctl disable httpd.service
rm '/etc/systemd/system/multi-user.target.wants/httpd.service'

$  systemctl is-enabled httpd.service

disabled

$  systemctl is-active httpd.service

unknown

$  systemctl is-active crond.service

inactive

$  systemctl is-enabled crond.service

enabled





서비스 설정 파일 확인하기


$ ls -al /usr/lib/systemd/system/httpd.service

-rw-r--r-- 1 root root 752 11월 20 06:35 /usr/lib/systemd/system/httpd.service

ls -al /usr/lib/systemd/system/crond.service

-rw-r--r--. 1 root root 284  7월 31  2014 /usr/lib/systemd/system/crond.service







<systemctl 커맨드 맛보기>


서비스 타입중 현재 실행중인 시스템 서비스 목록 보기


$ systemctl -t service -a --state running

UNIT                              LOAD   ACTIVE SUB     DESCRIPTION

proc-sys-fs-binfmt_misc.automount loaded active running Arbitrary Executable File Formats File System Automount Point

session-30.scope                  loaded active running Session 30 of user deploy

acpid.service                     loaded active running ACPI Event Daemon

auditd.service                    loaded active running Security Auditing Service

dbus.service                      loaded active running D-Bus System Message Bus

getty@tty1.service                loaded active running Getty on tty1

irqbalance.service                loaded active running irqbalance daemon

network.service                   loaded active running LSB: Bring up/down networking

ntpd.service                      loaded active running Network Time Service

rsyncd.service                    loaded active running fast remote file copy program daemon

rsyslog.service                   loaded active running System Logging Service

snmpd.service                     loaded active running Simple Network Management Protocol (SNMP) Daemon.

sshd.service                      loaded active running OpenSSH server daemon

systemd-journald.service          loaded active running Journal Service

systemd-logind.service            loaded active running Login Service

systemd-udevd.service             loaded active running udev Kernel Device Manager

dbus.socket                       loaded active running D-Bus System Message Bus Socket

systemd-journald.socket           loaded active running Journal Socket

systemd-udevd-control.socket      loaded active running udev Control Socket

systemd-udevd-kernel.socket       loaded active running udev Kernel Socket


LOAD   = Reflects whether the unit definition was properly loaded.

ACTIVE = The high-level unit activation state, i.e. generalization of SUB.

SUB    = The low-level unit activation state, values depend on unit type.


20 loaded units listed.

To show all installed unit files use 'systemctl list-unit-files'.



시스템의 모든 서비스의 간단한 모든 상태 정보를 보고 싶다면, 다음을 사용한다. 


$ systemctl --type service --all


UNIT                                  LOAD   ACTIVE   SUB     DESCRIPTION

acpid.service                         loaded active   running ACPI Event Daemon

auditd.service                        loaded active   running Security Auditing Service

brandbot.service                      loaded inactive dead    Flexible Branding Service

cloud-config.service                  loaded active   exited  Apply the settings specified in cloud-config

cloud-final.service                   loaded active   exited  Execute cloud user/final scripts

cloud-init-local.service              loaded active   exited  Initial cloud-init job (pre-networking)

cloud-init.service                    loaded active   exited  Initial cloud-init job (metadata service crawler)

crond.service                         loaded inactive dead    Command Scheduler

dbus.service                          loaded active   running D-Bus System Message Bus

display-manager.service               not-found inactive dead    display-manager.service

dracut-shutdown.service               loaded inactive dead    Restore /run/initramfs

emergency.service                     loaded inactive dead    Emergency Shell

exim.service                          not-found inactive dead    exim.service

getty@tty1.service                    loaded active   running Getty on tty1

ip6tables.service                     not-found inactive dead    ip6tables.service

iptables.service                      not-found inactive dead    iptables.service




유닛 파일 타입의 systemctl로 사용할 수 있는 시스템 서비스 목록을 본다.



$ systemctl list-unit-files

UNIT FILE                              STATE

proc-sys-fs-binfmt_misc.automount      static

dev-hugepages.mount                    static

dev-mqueue.mount                       static

proc-sys-fs-binfmt_misc.mount          static

sys-fs-fuse-connections.mount          static

sys-kernel-config.mount                static

sys-kernel-debug.mount                 static

tmp.mount                              disabled

brandbot.path                          disabled

systemd-ask-password-console.path      static

systemd-ask-password-plymouth.path     static

systemd-ask-password-wall.path         static

session-2.scope                        static

session-29.scope                       static

session-30.scope                       static

session-9.scope                        static

acpid.service                          enabled

arp-ethers.service                     disabled

atd.service                            disabled

auditd.service                         enabled

autovt@.service                        disabled

brandbot.service                       static

cloud-config.service                   enabled

cloud-final.service                    enabled

cloud-init-local.service               enabled

cloud-init.service                     enabled

...



리스닝하는 소켓 타입의 systemctl로 사용할 수 있는 시스템 서비스 목록을 본다.


$ systemctl list-sockets

LISTEN                          UNIT                         ACTIVATES

/dev/initctl                    systemd-initctl.socket       systemd-initctl.service

/dev/log                        systemd-journald.socket      systemd-journald.service

/run/systemd/journal/socket     systemd-journald.socket      systemd-journald.service

/run/systemd/journal/stdout     systemd-journald.socket      systemd-journald.service

/run/systemd/shutdownd          systemd-shutdownd.socket     systemd-shutdownd.service

/run/udev/control               systemd-udevd-control.socket systemd-udevd.service

/var/run/dbus/system_bus_socket dbus.socket                  dbus.service

kobject-uevent 1                systemd-udevd-kernel.socket  systemd-udevd.service


8 sockets listed.

Pass --all to see loaded but inactive sockets, too.




사용할 수 있는 모든 유닛 타입은 다음과 같다.


$ systemctl -t help

Available unit types:

service

socket

target

device

mount

automount

snapshot

timer

swap

path

slice

scope



특정 서비스의 dependency 유닛을 보려면 다음과 같은 커맨드를 사용한다.



$ systemctl list-dependencies crond.service

crond.service

├─system.slice

└─basic.target

  ├─microcode.service

  ├─rhel-autorelabel-mark.service

  ├─rhel-autorelabel.service

  ├─rhel-configure.service

  ├─rhel-dmesg.service

  ├─rhel-loadmodules.service

  ├─paths.target

  ├─slices.target

  │ ├─-.slice

  │ └─system.slice

  ├─sockets.target

  │ ├─dbus.socket

  │ ├─rsyncd.socket

  │ ├─systemd-initctl.socket

  │ ├─systemd-journald.socket

  │ ├─systemd-shutdownd.socket

  │ ├─systemd-udevd-control.socket

  │ └─systemd-udevd-kernel.socket

  ├─sysinit.target

  │ ├─dev-hugepages.mount

  │ ├─dev-mqueue.mount

  │ ├─kmod-static-nodes.service

  │ ├─plymouth-read-write.service

  │ ├─plymouth-start.service

  │ ├─proc-sys-fs-binfmt_misc.automount

  │ ├─sys-fs-fuse-connections.mount

  │ ├─sys-kernel-config.mount

  │ ├─sys-kernel-debug.mount

  │ ├─systemd-ask-password-console.path

  │ ├─systemd-binfmt.service

  │ ├─systemd-journal-flush.service

  │ ├─systemd-journald.service

  │ ├─systemd-modules-load.service

  │ ├─systemd-random-seed.service

  │ ├─systemd-sysctl.service

  │ ├─systemd-tmpfiles-setup-dev.service

  │ ├─systemd-tmpfiles-setup.service

  │ ├─systemd-udev-trigger.service

  │ ├─systemd-udevd.service

  │ ├─systemd-update-utmp.service

  │ ├─systemd-vconsole-setup.service

  │ ├─cryptsetup.target

  │ ├─local-fs.target

  │ │ ├─-.mount

  │ │ ├─rhel-import-state.service

  │ │ ├─rhel-readonly.service

  │ │ ├─systemd-fsck-root.service

  │ │ └─systemd-remount-fs.service

  │ └─swap.target

  │   └─swap-swapfile1.swap

  └─timers.target

    └─systemd-tmpfiles-clean.timer





'unix and linux' 카테고리의 다른 글

[python] carriage return 이슈  (0) 2016.05.27
dstat 툴  (0) 2016.05.23
[centos 7] realpath 명령어  (0) 2016.05.03
센트OS 7 다운로드 URL 설명  (0) 2016.05.02
setuid 동작 결과를 ps로 확인하기(ruser, euser)  (0) 2016.04.28
Posted by '김용환'
,




인터넷 찾아보니. 직접 그림을 그려서 뽐내는(?) 분들이 많이 계시네요. 우와 하는 찬탄사가...


http://www.deviantart.com/ 에서 fan art 또는 tradition art를 browse 해보시면 됩니다.


http://www.deviantart.com/browse/all/traditional/

http://www.deviantart.com/browse/all/traditional/drawings/technical/?order=67108864





좋은 분


http://frompencil2paper.deviantart.com/gallery/







Posted by '김용환'
,


다음 그림은 파티션 범위를 이해하게 하는 그림으로서 전체 윈도우 표현식이다.





* current row : 현재 로우


* X PRECEDING 또는 Y FOLLOWING : 현재 로우(currow row)의 앞/뒤로 N 개의 로우를 의미한다.


* UNBOUNDED PRECEDING : 시작 지점을 알리며, 해당 윈도우는 파티션의 1 번째 로우이다.


* UNBOUNDED FOLLOWING : 마지막 지점을 알린다. 해당 윈도우는 파티션의 마지막 로우이다.


UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: 테이블의 모든 로우를 의미하며, 1 번째와 마지막 로우를 각각 가르킨다.


* BETWEEN … AND : 윈도우의 시작 지점과 마지막 지점을 명세하기 위해 BETWEEN...AND 절을 사용한다. AND 앞의 표현식은 시작 지점을 정의하고, AND 뒤의 표현식은 마지막 지점을 정의한다. ROWS N PRECEDING 또는 ROWS UNBOUNDED PRECEDING와 같이 BETWEEN...AND 절을 생략한다면, 하이브는 기본적으로 윈도우의 처음 또는 N 번째 앞 부분을 시작 지점으로, 현재 로우를 마지막 지점으로 간주한다.



'hadoop' 카테고리의 다른 글

hadoop client 설치 URL  (0) 2016.10.24
hive 와 hadoop 버전 확인하기  (0) 2016.10.21
[hive] 정렬 키워드 - order by, sort by, cluster by, distribute by  (0) 2016.05.11
[hive] collect_set  (0) 2016.04.30
[hadoop] getmerge 명령어  (0) 2016.04.21
Posted by '김용환'
,