在apache中,hive 0.14我们可以通过支持ACID配置来更新和删除查询:
hive.configuration:
hive.support.concurrency – true
hive.enforce.bucketing – true
hive.exec.dynamic.partition.mode – nonstrict
hive.txn.manager – org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
hive.compactor.initiator.on – true (for exactly one instance of the Thrift metastore service)
hive.compactor.worker.threads-1
Run Code Online (Sandbox Code Playgroud)
但是当我使用hiveQL时出现以下错误show databases:
as@ubuntu:~$ hive
Logging initialized using configuration in jar:file:/home/as/hive/lib/hive-common-0.14.0.jar!/hive-log4j.properties<br>
SLF4J: Class path contains multiple SLF4J bindings.<br>
SLF4J: Found binding in [jar:file:/home/as/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]<br>
SLF4J: Found binding in [jar:file:/home/as/hive/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]<br>
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.<br>
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]<br>
hive> show databases;<br>
FAILED: LockException [Error …Run Code Online (Sandbox Code Playgroud) 我正在关注Joe Armstrong的书Programming Erlang, 2nd Edition,我们在那里制作文件服务器.
我的代码:
-module(afile_server).
-author("harith").
%% API
-export([start/1]).
start(Dir) -> spawn(afile_server, loop, [Dir]).
loop(Dir) ->
receive
{Client, list_dir} ->
Client ! {self(), file:list_dir(Dir)};
{Client, {get_file, File}} ->
File_Path = filename:join(Dir, File),
Client ! {self(), file:read_file(File_Path)}
end,
loop(Dir).
Run Code Online (Sandbox Code Playgroud)
我们可以看到,这loop是一种私有方法,不应暴露于外部世界.现在当我运行这个时,我得到:
1> FileServer = afile_server:start(".").
<0.33.0>
=ERROR REPORT==== 3-Jan-2015::06:58:56 ===
Error in process <0.33.0> with exit value: {undef,[{afile_server,loop,["."],[]}]}
2>
Run Code Online (Sandbox Code Playgroud)
但当我loop公开时:
-module(afile_server).
-author("harith").
%% API
-export([start/1, loop/1]).
start(Dir) -> spawn(afile_server, loop, [Dir]).
loop(Dir) ->
receive …Run Code Online (Sandbox Code Playgroud) 我在Erlang中遇到一个小问题.我想返回一个字符串的所有元音的列表.例如:
vowels:conditional("AGGEHA").
["A","E","A"]
Run Code Online (Sandbox Code Playgroud)
这是建议的代码:
-module(vowels).
-compile([export_all]).
isvowel('') -> false;
isvowel(C) -> if
C =:= "A" -> true;
C =:= "E" -> true;
C =:= "I" -> true;
C =:= "O" -> true;
C =:= "U" -> true;
true -> false
end.
conditional([]) -> [];
conditional([A|T]) -> case isvowel(A) of
true -> [A] ++ conditional(T);
false -> [1] ++ conditional(T)
end.
Run Code Online (Sandbox Code Playgroud)
问题是当我使用该conditional函数时,它总是返回false(或者在这种情况下,根据字符串的长度返回1的列表(我将其用作调试器)).有谁知道如何解决这个问题?
我正在玩Erlang并试图编写一个S表达式解析器.我发现使用堆栈和循环在Python中这是一个简单的任务,但对于我来说,作为不可变变量和Erlang数据结构的初学者,这是非常重要的.
我需要在Erlang中转换一个列表,如下所示:
X = ["0", "(", "1", "2", "3", ")"],
Res = transform(X). % ["0", ["1", "2", "3"]]
Run Code Online (Sandbox Code Playgroud)
到现在为止,我来到这里:
transform(List) ->
lists:map(fun(X)->
case string:equal("(", X) of
%% recursive call with sublist of List from "(" to ")" as argument
true -> transform_to_list(Lack)
end
end, List).
Run Code Online (Sandbox Code Playgroud)
不知道如何获取子列表Lack并将其作为参数传递.我正朝着正确的方向前进吗?
我正在考虑构建一个仅使用一次性密码的网站用户身份验证系统:每次通常使用普通密码(例如注册、登录、危险操作和帐户删除)时,用户都会在电子邮件中收到一个密码。
我看到的一些问题似乎并不重要:
不过,我没有看到这种方法被提及或在野外使用。它有什么主要缺点吗?非常感谢!
首先,我遇到了与这个问题How to show verify code suggest on Keyboard from Message相同的问题,然后当我收到一条包含 的消息时Your one time password is 123456,我的键盘中建议了密码,情况是,我不知道是什么我需要接收的短信的正确格式,在哪里可以看到可读短信 OTP 的某些文档或规则和说明?
在我给定的链接中,他们提供了一个视频链接,但由于某些个人原因,我无法观看。
我正在尝试解决以下问题:
编写一个名为响应的 Erlang 函数,它接受两个参数,一个名为 Pid 的进程 ID 和一个名为 Item 的 Erlang 项。该函数应该向 Pid 发送一条消息;消息应该是一个包含两个元素的元组:响应的进程 ID 和项目。然后,该函数应等待接收回消息。如果它收到的消息为真,则打印“这是正确的!” 如果它收到的消息是假的,则打印“那是不正确的!” 如果它收到的消息是错误,则打印“输入中存在错误”。如果消息是其他任何内容,则打印“收到无效消息”。
我写了以下内容:
respond(Pid,Item) ->
Pid ! {Pid,Item};
receive
true -> io:format(~p~n "That is correct",[]);
false -> io:format(~p~n "That is incorrect",[]);
error -> io:format(~p~n "There was an error in the input",[]);
_ -> io:format(~p~n "Invalid message received",[])
end.
Run Code Online (Sandbox Code Playgroud)
我编译代码时遇到的错误如下:
1> c(main).
main.erl:15: syntax error before: 'receive'
main.erl:2: function respond/2 undefined
error
Run Code Online (Sandbox Code Playgroud)
是什么导致了这个错误?我对这个问题的解决方法是否正确?
我试图弄清楚如何以maps允许我使用相同键处理元素的方式合并两个.
例如,合并
#{"Ala" => 1,"kota" => 3}
同
#{"kota" => 4}
应该导致:
#{"Ala" => 1,"kota" => 7}
erlang ×7
concurrency ×1
hadoop ×1
hive ×1
ios ×1
maps ×1
passwords ×1
s-expression ×1
sms ×1
syntax ×1