I'm trying to use the SpEL in Spinnaker pipeline to convert an artifact from base64 to JSON because I want to retrieve some field from that manifest. Any suggestions on how to do that?
Use #fromBase64(string) and #readJson(string) helpers
Related
I'm trying to use Athena to query some files that are in Ion format produced by the recently added Export To S3 feature of DynamoDB backups.
This is a blatantly stupid format which is basically the string $ion_1_0 followed by json. The unquoted $ion_1_0 string at the front makes the data invalid json.
I tried using the Ion Serde from here:
CREATE EXTERNAL TABLE mydb.mytable (
`myfields` string,
...
)
ROW FORMAT SERDE 'com.amazon.ionhiveserde.IonHiveSerDe'
LOCATION 's3:/.../dynamodb-export/AWSDynamoDB/01608775578817-a6944d97/data/'
TBLPROPERTIES ('has_encrypted_data'='true');
But got this:
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: com.amazon.ionhiveserde.IonHiveSerDe
UPDATE
Actually the format is even a little worse than I thought. The field names are not quoted. So it's not quite valid json even after stripping the $ion prefix.
ION is an open-source textual format which is a superset of JSON. Have you tried converting your ION file(s) with glue? ION is one of the format options supported (for input): https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-format.html
This QLDB workshop uses ION in its example, you could explore the cloudformation template/yaml or deploy the workflow and dig into the crawler and job it creates for some ideas: https://qldb-immersionday.workshop.aws/en/lab3/task3.html
Check out the ION cookbook for some additional information: https://amzn.github.io/ion-docs/guides/cookbook.html
And the specs: https://amzn.github.io/ion-docs/docs/spec.html
I need help for reaching my object's task target. I have got a BufferInputStream in a http component response and i need to convert these object in a pdf file. Can someone help me using component "File"? Thank you.
The HTTP Listener and Requester both will return an InputStrem...That InputStream will need to be read and converted into whatever is required downstream.
What is being received in that InputStream?
BTW - If the InputStream does not contain the PDF binary then you will need to use a third-party lib to assemble your data into a PDF format.
hexadecimal entity are converted into string while loading XML data into marklogic server please suggest the right solution for this. without using XLST charmap
There is now way to to this automatically.
In xquery in order to have hexadecimal show up you need to use the &# then the x like this
"©"
You could write a function that looks at the content that your loading in and finds all the hexadecimal already in there and converts them to this format.
What is the easiest way to parse XML in ActionScript3/Flex ?
By using e4X syntax.
Here are a few links to documentation that may help you:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/XML.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/XML.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2#top
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e71.html
http://www.ecma-international.org/publications/standards/Ecma-357.htm
We have an XML parser and tutorial here:
http://forea.ch/blog/2010/05/17/utils-parsing-xml/
We also have an XML creator, so you just create the data objects that your application needs and don't have to worry about XML if, for example, you're using XML for configuration data.
If you want to parse a XML to a Object .
you can use FLEXXB .its a wonderful lib.
I mean without input XML file.
I'm using Saxon-EE 9.2.
if you mean to validate the Xquery source file then, the only route I know of is to first convert it to XqueryX using xq2xqx.xsl and then use a xsd schema based on that
An XQuery source file isn't an XML document, so can't be validated with an XML schema. If you really need to, you can use the xq2xqx library to convert XQuery source files into XQueryX documents:
http://monet.nag.co.uk/xq2xml/
The code there needs some tidying up, the XQuery parser linked at
http://www.w3.org/2005/qt-applets/xgrammar.zip
and the Saxon jar - the free one here should work:
http://saxon.sourceforge.net/#F9.4HE
You should end up with a command line something like:
java -cp "saxon9.jar;xquery.jar;trans2.jar" net.sf.saxon.Transform -it:main -o:"xq2xqx.log" -xsl:"xq2xqx.xsl" dump="no$2" xq=test.xquery
which will generate test.xqueryx, and you can then validate the document against the official w3.org schema:
http://www.w3.org/2005/XQueryX/xqueryx.xsd