我想在hive中将数组转换为字符串.我想collect_set数组值转换为字符串而不用[[""]].
select actor, collect_set(date) as grpdate from actor_table group by actor;
Run Code Online (Sandbox Code Playgroud)
这[["2016-07-01", "2016-07-02"]]将成为2016-07-01, 2016-07-02
(\xe2\x86\x91 这根本不是我问题的答案!!:( )
\n\n你好~我正在使用chartJS来绘制折线图。
\n\n var areaChartData = {\n labels: ["2016-02-11_19:59:24", "2016-02-11_20:59:24", "2016-02-12_21:59:24", "2016-02-21_22:59:24", "2016-02-21_23:59:24", "2016-02-22_19:59:24", "2016-02-22_23:59:24", "2016-02-23_23:59:24", "2016-02-24_23:59:24", "2016-02-25_23:59:24"],\n datasets: [\n {\n label: "Elec",\n fillColor: "rgba(210, 214, 222, 1)",\n strokeColor: "rgba(210, 214, 222, 1)",\n pointColor: "rgba(210, 214, 222, 1)",\n pointStrokeColor: "#c1c7d1",\n pointHighlightFill: "#fff",\n pointHighlightStroke: "rgba(220,220,220,1)",\n data: [65, 59, 80, 81, 56, 55, 40, 23, 22, 21]\n },\n {\n label: "Goods",\n fillColor: "rgba(60,141,188,0.9)",\n strokeColor: "rgba(60,141,188,0.8)",\n pointColor: "#3b8bba",\n pointStrokeColor: "rgba(60,141,188,1)",\n pointHighlightFill: "#fff",\n pointHighlightStroke: "rgba(60,141,188,1)",\n data: [28, 48, 40, 19, 86, …Run Code Online (Sandbox Code Playgroud) 我想与pymysql一起使用在mysql脚本下运行。
START TRANSACTION;
BEGIN;
insert into ~~~
COMMIT;
Run Code Online (Sandbox Code Playgroud)
我的python源代码是
connection = pymysql.connect(~~~~~~~)
with connection.cursor() as cursor :
connection.begin()
cursor.execute(~~.sql)
connection.commit()
connection.close()
Run Code Online (Sandbox Code Playgroud)
我的问题是“ connection.begin()”与“ START TRANSACTION; BEGIN;”相同。?我要使用“开始交易;开始;”
我想在齐柏林飞艇中使用 anaconda 。
所以我修改 /zeppelin/conf/zeppelin-env.sh 中的配置文件,如下所示。
export SPARK_HOME=/home/jin/spark
export PYTHONPATH=/home/jin/anaconda3/bin/python
export PYSPARK_PYTHON=/home/jin/spark/python
Run Code Online (Sandbox Code Playgroud)
因为我认为当我修改 PYTHONPATH 时,我可以使用 anaconda 版本。
https://zeppelin.apache.org/docs/0.6.2/interpreter/python.html
Path of the already installed Python binary (could be python2 or python3).
If python is not in your $PATH you can set the absolute directory
(example :/usr/bin/python)
Run Code Online (Sandbox Code Playgroud)
但python版本没有改变。我尝试检查 zeppelin 笔记本中的 python 版本。
%python
import sys
print(sys.version)
print(sys.version_info)
2.7.12 (default, Nov 19 2016, 06:48:10)
Run Code Online (Sandbox Code Playgroud)
如何在 zeppelin 中使用 anaconda?
我想检查雅典娜的分区列表。
我这样查询。
show partitions table_name
Run Code Online (Sandbox Code Playgroud)
但是我要搜索特定表是否存在。
所以我使用了如下查询,但是没有返回结果。
show partitions table_name partition(dt='2010-03-03')
Run Code Online (Sandbox Code Playgroud)
因为dt还包含小时数据。
dt='2010-03-03-01', dt='2010-03-03-02', ...........
Run Code Online (Sandbox Code Playgroud)
那么,当我输入“ 2010-03-03”然后搜索“ 2010-03-03-01”,“ 2010-03-03-02”时,有什么方法可以搜索吗?
我需要像这样分开分区吗?
dt='2010-03-03', dh='01'
Run Code Online (Sandbox Code Playgroud)
显示分区table_name在Hive中仅返回500行。雅典娜也一样吗?
我想从AWS中的Athena获取结果值格式JSON。
当我从雅典娜选择时,结果格式如下。
{test.value={report_1=test, report_2=normal, report_3=hard}}
Run Code Online (Sandbox Code Playgroud)
有什么方法可以将JSON格式的结果替换为“:”?
列格式为
map<string,map<string,string>>
Run Code Online (Sandbox Code Playgroud) 我想使用 python 中 scikit 包中的 calinski 和 harabasz 验证自动选择 k(k 均值聚类)(metrics.calinski_harabaz_score)。
我循环遍历所有聚类范围以选择 calinski_harabaz_score 的最大值
for kClusterCnt in range(2, 21) :
value = metrics.calinski_harabaz_score(datasets.data, kmCls.labels_)
Run Code Online (Sandbox Code Playgroud)
仅使用该方法是否有任何缺陷或错误?