我有列出所有活动的页面.但是事件列表取决于用户是否是管理员.如果我在浏览模型对象的页面上使用片段缓存,它将缓存管理员的所有事件.
它可以从缓存服务到另一个非管理员用户吗?如果是,我如何为非管理员和管理员用户使用片段缓存.
我正在尝试使用C#在excel工作簿中创建数据透视表。来源是Odata Feed URL。我写了以下代码:
    string connectionString = @"DATAFEED;Data Source=" + odataURL + ";Namespaces to Include=*;Max Received Message Size=4398046511104;Integrated Security=Basic;User ID=" + "xyz" + ";Password=" + "bvby" + ";Persist Security Info=true;Base Url=" + odataURL;
    Excel.PivotCache pivotCache = app.ActiveWorkbook.PivotCaches().Add(Excel.XlPivotTableSourceType.xlExternal, Type.Missing);
    pivotCache.Connection = connectionString;
Run Code Online (Sandbox Code Playgroud)
我这样做时会引发以下异常pivotCache.Connection:
System.Runtime.InteropServices.COMException was caught
HResult=-2146827284
Message=Exception from HRESULT: 0x800A03EC
Source=""
ErrorCode=-2146827284
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Microsoft.Office.Interop.Excel.PivotCache.set_Connection(Object value)
at ConsoleApplication2.Program.createWorkBookHelper(Application app, Workbook workbook, String odataURL, String nameOfWorkBook) 
in d:\ReportingApp\Dev\PDS\Excel Plugin\ConsoleApplication2\ConsoleApplication2\Program.cs:line …Run Code Online (Sandbox Code Playgroud) 有一个用例,我们想要从具有 JSON 的 S3 读取文件。然后,根据特定的 JSON 节点值,我们希望对数据进行分组并将其写入 S3。
我能够读取数据,但无法找到关于如何基于 JSON 密钥对数据进行分区然后上传到 S3 的好示例。任何人都可以提供任何示例或向我指出可以帮助我解决此用例的教程吗?
创建数据框后,我得到了数据的架构:
root
 |-- customer: struct (nullable = true)
 |    |-- customerId: string (nullable = true)
 |-- experiment: string (nullable = true)
 |-- expiryTime: long (nullable = true)
 |-- partitionKey: string (nullable = true)
 |-- programId: string (nullable = true)
 |-- score: double (nullable = true)
 |-- startTime: long (nullable = true)
 |-- targetSets: array (nullable = true)
 |    |-- element: struct (containsNull = true)
 |    |    |-- …Run Code Online (Sandbox Code Playgroud) 我有具有以下架构的 DataFrame:
 |-- data: struct (nullable = true)
 |    |-- asin: string (nullable = true)
 |    |-- customerId: long (nullable = true)
 |    |-- eventTime: long (nullable = true)
 |    |-- marketplaceId: long (nullable = true)
 |    |-- rating: long (nullable = true)
 |    |-- region: string (nullable = true)
 |    |-- type: string (nullable = true)
 |-- uploadedDate: long (nullable = true)
Run Code Online (Sandbox Code Playgroud)
我想分解结构,使 asin、customerId、eventTime 等所有元素都成为 DataFrame 中的列。我尝试了爆炸函数,但它适用于数组而不是结构类型。是否可以将数据框转换为以下数据框:
     |-- asin: string (nullable = true)
     |-- customerId: long (nullable = true) …Run Code Online (Sandbox Code Playgroud) 我的Ruby on Rails应用程序,我从数据库中获取UTC时间(即在活动记录对象中)。我想在显示到 UI 之前将时间转换为 PST。我尝试这样做 dataFromDB = DataTable.find_by_sql("select time from datatables"); dataFromDB[0].time = dataFromDB[0].time.in_time_zone("太平洋时间(美国和加拿大)")
但它不起作用,它显示相同的时间,即 UTC 时间。
我尝试在EMR上运行Pig脚本,如:
pig -f s3://bucket-name/loadData.pig
但它失败了,错误:
错误2999:意外的内部错误.空值
org.apache.pmpl.impl.io.FileLocalizer.fetchFilesInternal(FileLocalizer.java:778)中的org.apache.pig.impl.io.FileLocalizer.fetchFiles(FileLocalizer.java:746)中的java.lang.NullPointerException. apache.pig.PigServer.registerJar(PigServer.java:458)org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:433)atg.apache.pig.tools.pigscript.parser.PigScriptParser.解析(PigScriptParser.java:445)org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:194)org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:170) org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)org.apache.pig.Main.run(Main.java:479)org.apache.pig.Main.main(Main .java:159)在sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java. lang.reflect.Method.invoke(Method.java :606)在org.apache.hadoop.util.RunJar.main(RunJar.java:187)
loadData.pig看起来像:
A = load '/ajasing/input/input.txt' USING PigStorage('\t', '-noschema');
store A into '/ajasing/output1444/input1444.txt';
Run Code Online (Sandbox Code Playgroud)
我正在运行Pig版本0.11.1,hadoop版本1.0.3和AMI版本2.4.6.
如果我在本地执行这个猪,即通过在EMR集群上本地复制猪脚本,它工作正常.但是,如果猪脚本源是s3,它会因上述错误而失败.
请告诉我这里有什么问题.
hadoop ×3
amazon-s3 ×2
apache-spark ×2
amazon-emr ×1
apache-pig ×1
c# ×1
caching ×1
excel ×1
mapreduce ×1
memcached ×1
pivot ×1
pst ×1
scala ×1
timezone ×1
utc ×1