[SPARK-19041][SS] Fix code snippet compilation issues in Structured Streaming Programming Guide
[SPARK-19041][SS] Fix code snippet compilation issues in Structured Streaming Programming Guide

## What changes were proposed in this pull request?

Currently some code snippets in the programming guide just do not compile. We should fix them.

## How was this patch tested?

```
SKIP_API=1 jekyll build
```

## Screenshot from part of the change:

![snip20161231_37](https://cloud.githubusercontent.com/assets/15843379/21576864/cc52fcd8-cf7b-11e6-8bd6-f935d9ff4a6b.png)

Author: Liwei Lin <lwlin7@gmail.com>

Closes #16442 from lw-lin/ss-pro-guide-.

BryanCutler/spark,someorz/spark,maropu/spark,brad-kaiser/spark,techaddict/spark,mzl9039/spark,ericvandenbergfb/spark,rednaxelafx/apache-spark,nilsgrabbert/spark,mahak/spark,ericvandenbergfb/spark,zero323/spark,pgandhi999/spark,mdespriee/spark,dongjoon-hyun/spark,ddna1021/spark,apache-spark-on-k8s/spark,liyichao/spark,cin/spark,srowen/spark,aosagie/spark,JerryLead/spark,publicRoman/spark,zuotingbing/spark,xflin/spark,akopich/spark,witgo/spark,patrick-nicholson/spark,apache/spark,saturday-shi/spark,rikima/spark,joseph-torres/spark,dhruve/spark,zuotingbing/spark,bravo-zhang/spark,liyichao/spark,xuanyuanking/spark,lvdongr/spark,WindCanDie/spark,ron8hu/spark,sahilTakiar/spark,JoshRosen/spark,xuanyuanking/spark,someorz/spark,zhouyejoe/spark,wangyum/spark,tengpeng/spark,LantaoJin/spark,aokolnychyi/spark,eyalfa/spark,HyukjinKwon/spark,mzl9039/spark,sahilTakiar/spark,matthewfranglen/spark,techaddict/spark,adrian-ionescu/apache-spark,lvdongr/spark,apache/spark,JerryLead/spark,lvdongr/spark,akopich/spark,ddna1021/spark,guoxiaolongzte/spark,chuckchen/spark,SHASHANKB/spark,MLnick/spark,shuangshuangwang/spark,aosagie/spark,mzl9039/spark,janewangfb/spark,janewangfb/spark,markhamstra/spark,shubhamchopra/spark,ConeyLiu/spark,srowen/spark,lxsmnv/spark,nlalevee/spark,zzcclp/spark,loneknightpy/spark,zhouyejoe/spark,mzl9039/spark,panfengfeng/spark,liutang123/spark,ron8hu/spark,LantaoJin/spark,cloud-fan/spark,zero323/spark,debugger87/spark,gengliangwang/spark,darionyaphet/spark,byakuinss/spark,eyalfa/spark,shuangshuangwang/spark,BryanCutler/spark,wzhfy/spark,esi-mineset/spark,narahari92/spark,tejasapatil/spark,1haodian/spark,apache/spark,huang1900/spark,ajaysaini725/spark,skonto/spark,wzhfy/spark,mike0sv/spark,rezasafi/spark,Aegeaner/spark,jlopezmalla/spark,rekhajoshm/spark,apache-spark-on-k8s/spark,HyukjinKwon/spark,brad-kaiser/spark,ptkool/spark,apache/spark,tengpeng/spark,zhouyejoe/spark,ericvandenbergfb/spark,zuotingbing/spark,highfei2011/spark,stanzhai/spark,narahari92/spark,caneGuy/spark,JoshRosen/spark,nilsgrabbert/spark,publicRoman/spark,ddna1021/spark,apache/spark,brad-kaiser/spark,tengpeng/spark,panfengfeng/spark,ueshin/apache-spark,saltstar/spark,shubhamchopra/spark,ptkool/spark,alunarbeach/spark,ericvandenbergfb/spark,rekhajoshm/spark,bravo-zhang/spark,wangmiao1981/spark,mdespriee/spark,jlopezmalla/spark,MLnick/spark,ioana-delaney/spark,jkbradley/spark,bOOm-X/spark,MLnick/spark,srowen/spark,joseph-torres/spark,1haodian/spark,kiszk/spark,sureshthalamati/spark,taroplus/spark,publicRoman/spark,akopich/spark,michalsenkyr/spark,spark-test/spark,nlalevee/spark,kevinyu98/spark,UndeadBaneGitHub/spark,bOOm-X/spark,minixalpha/spark,ConeyLiu/spark,adrian-ionescu/apache-spark,cloud-fan/spark,yanboliang/spark,setjet/spark,bdrillard/spark,brad-kaiser/spark,BryanCutler/spark,hvanhovell/spark,shaneknapp/spark,dhruve/spark,andrewor14/spark,holdenk/spark,debugger87/spark,milliman/spark,jkbradley/spark,techaddict/spark,xflin/spark,michalsenkyr/spark,nilsgrabbert/spark,eyalfa/spark,huang1900/spark,debugger87/spark,someorz/spark,holdenk/spark,mahak/spark,spark-test/spark,ajaysaini725/spark,JoshRosen/spark,aokolnychyi/spark,dbtsai/spark,wzhfy/spark,Aegeaner/spark,shubhamchopra/spark,nilsgrabbert/spark,ajaysaini725/spark,patrick-nicholson/spark,saltstar/spark,akopich/spark,xuanyuanking/spark,jianran/spark,nilsgrabbert/spark,ddna1021/spark,bOOm-X/spark,zzcclp/spark,LantaoJin/spark,gengliangwang/spark,map222/spark,jkbradley/spark,jiangxb1987/spark,mahak/spark,jrshust/spark,minixalpha/spark,witgo/spark,rednaxelafx/apache-spark,narahari92/spark,patrick-nicholson/spark,saltstar/spark,nchammas/spark,maropu/spark,dbtsai/spark,xflin/spark,rednaxelafx/apache-spark,milliman/spark,cin/spark,JoshRosen/spark,hhbyyh/spark,1haodian/spark,zero323/spark,taroplus/spark,narahari92/spark,holdenk/spark,poffuomo/spark,gengliangwang/spark,sahilTakiar/spark,SHASHANKB/spark,hvanhovell/spark,nlalevee/spark,goldmedal/spark,WeichenXu123/spark,kiszk/spark,joseph-torres/spark,UndeadBaneGitHub/spark,huang1900/spark,jrshust/spark,sahilTakiar/spark,skonto/spark,Aegeaner/spark,ConeyLiu/spark,srowen/spark,goldmedal/spark,shuangshuangwang/spark,loneknightpy/spark,liyichao/spark,facaiy/spark,WindCanDie/spark,zhouyejoe/spark,pgandhi999/spark,eyalfa/spark,map222/spark,apache/spark,zuotingbing/spark,shuangshuangwang/spark,dongjoon-hyun/spark,guoxiaolongzte/spark,stanzhai/spark,mahak/spark,esi-mineset/spark,apache-spark-on-k8s/spark,lvdongr/spark,ueshin/apache-spark,saltstar/spark,panfengfeng/spark,jlopezmalla/spark,aray/spark,byakuinss/spark,akopich/spark,wangyum/spark,map222/spark,byakuinss/spark,hhbyyh/spark,skonto/spark,jkbradley/spark,aosagie/spark,jianran/spark,huang1900/spark,mdespriee/spark,jkbradley/spark,highfei2011/spark,markhamstra/spark,poffuomo/spark,someorz/spark,aosagie/spark,bravo-zhang/spark,bravo-zhang/spark,SHASHANKB/spark,mahak/spark,cin/spark,highfei2011/spark,ioana-delaney/spark,WeichenXu123/spark,HyukjinKwon/spark,rednaxelafx/apache-spark,WeichenXu123/spark,setjet/spark,lxsmnv/spark,dhruve/spark,joseph-torres/spark,dbtsai/spark,icexelloss/spark,esi-mineset/spark,srowen/spark,mike0sv/spark,JerryLead/spark,BryanCutler/spark,jkbradley/spark,dbtsai/spark,LantaoJin/spark,techaddict/spark,zero323/spark,HyukjinKwon/spark,ioana-delaney/spark,szhem/spark,BryanCutler/spark,yanboliang/spark,saltstar/spark,witgo/spark,sahilTakiar/spark,alunarbeach/spark,mzl9039/spark,lxsmnv/spark,hvanhovell/spark,stanzhai/spark,lxsmnv/spark,kissmetrics/spark,facaiy/spark,wangmiao1981/spark,panfengfeng/spark,lxsmnv/spark,HyukjinKwon/spark,alunarbeach/spark,goldmedal/spark,witgo/spark,caneGuy/spark,aosagie/spark,markhamstra/spark,wangmiao1981/spark,lvdongr/spark,ConeyLiu/spark,kevinyu98/spark,zzcclp/spark,cloud-fan/spark,nilsgrabbert/spark,nlalevee/spark,loneknightpy/spark,wangyum/spark,mike0sv/spark,WeichenXu123/spark,Aegeaner/spark,ajaysaini725/spark,brad-kaiser/spark,mahak/spark,holdenk/spark,1haodian/spark,map222/spark,ueshin/apache-spark,tejasapatil/spark,saltstar/spark,sureshthalamati/spark,esi-mineset/spark,debugger87/spark,cin/spark,byakuinss/spark,dhruve/spark,mahak/spark,jlopezmalla/spark,sahilTakiar/spark,caneGuy/spark,nchammas/spark,liyichao/spark,gengliangwang/spark,kevinyu98/spark,jrshust/spark,ahnqirage/spark,pgandhi999/spark,sachintyagi22/spark,bdrillard/spark,cin/spark,sureshthalamati/spark,UndeadBaneGitHub/spark,Aegeaner/spark,MLnick/spark,shaneknapp/spark,taroplus/spark,skonto/spark,minixalpha/spark,spark-test/spark,wangmiao1981/spark,sureshthalamati/spark,JerryLead/spark,hvanhovell/spark,markhamstra/spark,joseph-torres/spark,bdrillard/spark,jrshust/spark,dongjoon-hyun/spark,alunarbeach/spark,cloud-fan/spark,1haodian/spark,saturday-shi/spark,mike0sv/spark,apache-spark-on-k8s/spark,wzhfy/spark,ddna1021/spark,zzcclp/spark,darionyaphet/spark,gengliangwang/spark,rednaxelafx/apache-spark,ConeyLiu/spark,rezasafi/spark,rezasafi/spark,nchammas/spark,byakuinss/spark,BryanCutler/spark,loneknightpy/spark,maropu/spark,bdrillard/spark,bravo-zhang/spark,jiangxb1987/spark,WindCanDie/spark,ConeyLiu/spark,sahilTakiar/spark,SHASHANKB/spark,JoshRosen/spark,pgandhi999/spark,icexelloss/spark,taroplus/spark,janewangfb/spark,eyalfa/spark,facaiy/spark,janewangfb/spark,andrewor14/spark,tejasapatil/spark,publicRoman/spark,zuotingbing/spark,milliman/spark,bOOm-X/spark,dbtsai/spark,adrian-ionescu/apache-spark,actuaryzhang/spark,wzhfy/spark,WindCanDie/spark,wangyum/spark,kissmetrics/spark,vinodkc/spark,michalsenkyr/spark,map222/spark,szhem/spark,jianran/spark,liyichao/spark,bOOm-X/spark,setjet/spark,WindCanDie/spark,mdespriee/spark,andrewor14/spark,ueshin/apache-spark,kissmetrics/spark,kevinyu98/spark,kissmetrics/spark,LantaoJin/spark,goldmedal/spark,shubhamchopra/spark,liutang123/spark,vinodkc/spark,szhem/spark,eyalfa/spark,shubhamchopra/spark,kiszk/spark,byakuinss/spark,map222/spark,liutang123/spark,techaddict/spark,ioana-delaney/spark,ron8hu/spark,zero323/spark,aokolnychyi/spark,zuotingbing/spark,dongjoon-hyun/spark,mzl9039/spark,JoshRosen/spark,hhbyyh/spark,setjet/spark,jlopezmalla/spark,michalsenkyr/spark,someorz/spark,debugger87/spark,cin/spark,JoshRosen/spark,szhem/spark,xflin/spark,jiangxb1987/spark,actuaryzhang/spark,wangyum/spark,ptkool/spark,pgandhi999/spark,jiangxb1987/spark,chuckchen/spark,jrshust/spark,joseph-torres/spark,ueshin/apache-spark,skonto/spark,cloud-fan/spark,nchammas/spark,icexelloss/spark,dongjoon-hyun/spark,byakuinss/spark,ioana-delaney/spark,jlopezmalla/spark,eyalfa/spark,szhem/spark,taroplus/spark,janewangfb/spark,ioana-delaney/spark,stanzhai/spark,ahnqirage/spark,minixalpha/spark,pgandhi999/spark,andrewor14/spark,sachintyagi22/spark,bravo-zhang/spark,aosagie/spark,rikima/spark,darionyaphet/spark,shubhamchopra/spark,nlalevee/spark,rikima/spark,1haodian/spark,aokolnychyi/spark,jianran/spark,ericvandenbergfb/spark,shaneknapp/spark,cloud-fan/spark,actuaryzhang/spark,kiszk/spark,markhamstra/spark,xflin/spark,WindCanDie/spark,aray/spark,jianran/spark,spark-test/spark,dhruve/spark,kissmetrics/spark,ptkool/spark,michalsenkyr/spark,bdrillard/spark,ddna1021/spark,ahnqirage/spark,caneGuy/spark,stanzhai/spark,witgo/spark,vinodkc/spark,WeichenXu123/spark,icexelloss/spark,SHASHANKB/spark,mzl9039/spark,alunarbeach/spark,tengpeng/spark,michalsenkyr/spark,jianran/spark,mike0sv/spark,spark-test/spark,taroplus/spark,minixalpha/spark,patrick-nicholson/spark,highfei2011/spark,aray/spark,techaddict/spark,sachintyagi22/spark,witgo/spark,rezasafi/spark,ajaysaini725/spark,LantaoJin/spark,joseph-torres/spark,maropu/spark,mike0sv/spark,yanboliang/spark,rikima/spark,maropu/spark,chuckchen/spark,nilsgrabbert/spark,adrian-ionescu/apache-spark,guoxiaolongzte/spark,wangmiao1981/spark,ptkool/spark,hvanhovell/spark,mdespriee/spark,tejasapatil/spark,vinodkc/spark,spark-test/spark,sachintyagi22/spark,alunarbeach/spark,tengpeng/spark,publicRoman/spark,milliman/spark,dhruve/spark,loneknightpy/spark,kiszk/spark,witgo/spark,vinodkc/spark,narahari92/spark,wzhfy/spark,Aegeaner/spark,srowen/spark,skonto/spark,UndeadBaneGitHub/spark,spark-test/spark,brad-kaiser/spark,akopich/spark,holdenk/spark,aray/spark,adrian-ionescu/apache-spark,liutang123/spark,adrian-ionescu/apache-spark,facaiy/spark,ahnqirage/spark,panfengfeng/spark,bravo-zhang/spark,saturday-shi/spark,chuckchen/spark,rednaxelafx/apache-spark,darionyaphet/spark,cin/spark,sureshthalamati/spark,poffuomo/spark,jiangxb1987/spark,saturday-shi/spark,pgandhi999/spark,ron8hu/spark,kiszk/spark,WeichenXu123/spark,yanboliang/spark,aokolnychyi/spark,aokolnychyi/spark,poffuomo/spark,patrick-nicholson/spark,facaiy/spark,debugger87/spark,zero323/spark,ajaysaini725/spark,vinodkc/spark,milliman/spark,rezasafi/spark,kevinyu98/spark,lxsmnv/spark,debugger87/spark,tejasapatil/spark,sureshthalamati/spark,darionyaphet/spark,minixalpha/spark,map222/spark,andrewor14/spark,holdenk/spark,xuanyuanking/spark,bdrillard/spark,sachintyagi22/spark,maropu/spark,nchammas/spark,rezasafi/spark,JerryLead/spark,UndeadBaneGitHub/spark,rekhajoshm/spark,aray/spark,mdespriee/spark,publicRoman/spark,chuckchen/spark,rikima/spark,xuanyuanking/spark,hhbyyh/spark,liyichao/spark,UndeadBaneGitHub/spark,nlalevee/spark,nlalevee/spark,huang1900/spark,nchammas/spark,patrick-nicholson/spark,actuaryzhang/spark,xuanyuanking/spark,markhamstra/spark,chuckchen/spark,ericvandenbergfb/spark,esi-mineset/spark,dongjoon-hyun/spark,tejasapatil/spark,nchammas/spark,caneGuy/spark,stanzhai/spark,ConeyLiu/spark,narahari92/spark,andrewor14/spark,shaneknapp/spark,jianran/spark,apache/spark,kissmetrics/spark,zhouyejoe/spark,lvdongr/spark,ron8hu/spark,setjet/spark,xflin/spark,facaiy/spark,setjet/spark,dhruve/spark,guoxiaolongzte/spark,liutang123/spark,sachintyagi22/spark,liutang123/spark,esi-mineset/spark,rednaxelafx/apache-spark,narahari92/spark,holdenk/spark,vinodkc/spark,bOOm-X/spark,zzcclp/spark,skonto/spark,yanboliang/spark,rekhajoshm/spark,MLnick/spark,lxsmnv/spark,apache-spark-on-k8s/spark,wangmiao1981/spark,setjet/spark,UndeadBaneGitHub/spark,goldmedal/spark,techaddict/spark,WindCanDie/spark,dbtsai/spark,minixalpha/spark,bdrillard/spark,yanboliang/spark,tengpeng/spark,guoxiaolongzte/spark,brad-kaiser/spark,saturday-shi/spark,tengpeng/spark,ueshin/apache-spark,adrian-ionescu/apache-spark,WeichenXu123/spark,szhem/spark,hhbyyh/spark,MLnick/spark,kissmetrics/spark,loneknightpy/spark,darionyaphet/spark,ericvandenbergfb/spark,MLnick/spark,ron8hu/spark,xflin/spark,ioana-delaney/spark,shaneknapp/spark,rekhajoshm/spark,ajaysaini725/spark,LantaoJin/spark,liutang123/spark,kevinyu98/spark,HyukjinKwon/spark,lvdongr/spark,bOOm-X/spark,poffuomo/spark,patrick-nicholson/spark,jrshust/spark,zero323/spark,kiszk/spark,goldmedal/spark,jrshust/spark,actuaryzhang/spark,hhbyyh/spark,shaneknapp/spark,caneGuy/spark,esi-mineset/spark,highfei2011/spark,someorz/spark,huang1900/spark,poffuomo/spark,ptkool/spark,panfengfeng/spark,ueshin/apache-spark,aray/spark,milliman/spark,janewangfb/spark,Aegeaner/spark,BryanCutler/spark,ahnqirage/spark,shuangshuangwang/spark,wangyum/spark,markhamstra/spark,sachintyagi22/spark,hvanhovell/spark,someorz/spark,icexelloss/spark,dongjoon-hyun/spark,actuaryzhang/spark,rekhajoshm/spark,rikima/spark,kevinyu98/spark,guoxiaolongzte/spark,saturday-shi/spark,ddna1021/spark,rikima/spark,ahnqirage/spark,srowen/spark,shubhamchopra/spark,jlopezmalla/spark,guoxiaolongzte/spark,JerryLead/spark,stanzhai/spark,sureshthalamati/spark,szhem/spark,apache-spark-on-k8s/spark,yanboliang/spark,actuaryzhang/spark,wzhfy/spark,zhouyejoe/spark,zzcclp/spark,andrewor14/spark,poffuomo/spark,HyukjinKwon/spark,zuotingbing/spark,mdespriee/spark,janewangfb/spark,aray/spark,shaneknapp/spark,maropu/spark,saturday-shi/spark,mike0sv/spark,aosagie/spark,ron8hu/spark,chuckchen/spark,zzcclp/spark,JerryLead/spark,dbtsai/spark,taroplus/spark,caneGuy/spark,milliman/spark,goldmedal/spark,gengliangwang/spark,ptkool/spark,akopich/spark,icexelloss/spark,hvanhovell/spark,huang1900/spark,zhouyejoe/spark,ahnqirage/spark,aokolnychyi/spark,saltstar/spark,cloud-fan/spark,shuangshuangwang/spark,rezasafi/spark,liyichao/spark,highfei2011/spark,xuanyuanking/spark,alunarbeach/spark,loneknightpy/spark,apache-spark-on-k8s/spark,highfei2011/spark,facaiy/spark,rekhajoshm/spark,SHASHANKB/spark,icexelloss/spark,gengliangwang/spark,hhbyyh/spark,jiangxb1987/spark,panfengfeng/spark,darionyaphet/spark,jiangxb1987/spark,1haodian/spark,SHASHANKB/spark,publicRoman/spark,michalsenkyr/spark,wangyum/spark,wangmiao1981/spark,shuangshuangwang/spark,tejasapatil/spark,jkbradley/spark