coding UTF-8 import sys from org python core import codecs from jarray

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: UTF-8 -*-
import sys
from org.python.core import codecs
from jarray import zeros
from java.lang import Object
from java.lang import Boolean
from java.lang import String
codecs().setDefaultEncoding("utf8")
if (params.get("month") is None or params.get("month").size() == 0):
resutlDs = None
else:
strmonth = params.get("month").get(0).getCache()
stryear = String.valueOf(params.get("year"))
params.put("strmonth", strmonth)
params.put("stryear", stryear)
data = ds[0]
# проставляем isEmpty
data.getFields().add('isEmpty')
for i in range(0, data.size()):
row = data.getData().get(i)
newRow = zeros(len(row)+1, Object)
for j in range(0, len(row)):
newRow[j] = row[j]
noData = 1
for j in range(1, len(row)):
if not (row[j] is None):
noData = 0
break
if noData:
newRow[len(row)] = Boolean("true");
else:
newRow[len(row)] = Boolean("false");
resultDs = data