Metabase/Clojure error: Unfreezable type: class org.postgresql.jdbc.PgArray - postgresql

Anyone knows something about this error in Metabase (or a similar one in any Clojure program)?
Unfreezable type: class org.postgresql.jdbc.PgArray
It happens regularly, but not always, when I use a postgresql array type (i.e. TEXT[]) in a question => it probably depends on the exact data in the pgArray somehow, but I wasn't able to figure out how.
There is a workaround to get rid of it: retype/cast all pgArrays to TEXT (or VARCHAR). But I would really like to understand why this is happening. Thx for any insights.

Metabase uses a library called Nippy:
https://github.com/metabase/metabase/blob/master/project.clj#L61
Nippy provides fast serialization of common types. The error "Unfreezable type":
https://github.com/ptaoussanis/nippy/blob/master/src/taoensso/nippy.clj#L720
occurs when Nippy comes across data of a type it doesn't know how to serialize. PgArray, as a bespoke Postgres array type, is evidently one of those.
Providing serialization guidance to Nippy is not hard. Maybe make an issue for the Metabase folks with your details asking if they can do this?

Related

Is it possible to cast quickfix messages into specific classes in order to have intellisense guide?

I´m pretty new in quickfix, but according to official doc, even in the case you are typing (in the way of assigning a type) the message you want to send. You have to know in advance which are the available fields. I was expecting to find something more programming friendly. Creating a new OrderCancelRequest, would create an instance where you have a pack of acknowledged variables-properties and IDE would help you to know what field must be provided.
In fact
Type Safe Messages And Fields
void sendOrderCancelRequest()
{
FIX41::OrderCancelRequest message(
FIX::OrigClOrdID("123"),
FIX::ClOrdID("321"),
FIX::Symbol("LNUX"),
FIX::Side(FIX::Side_BUY));
message.set(FIX::Text("Cancel My Order!"));
FIX::Session::sendToTarget(message, SenderCompID("TW"), TargetCompID("TARGET"));
}
and Type Safe Field Only
void sendOrderCancelRequest()
{
FIX::Message message;
FIX::Header header& = message.getHeader();
header.setField(FIX::BeginString("FIX.4.2"));
header.setField(FIX::SenderCompID(TW));
header.setField(FIX::TargetCompID("TARGET"));
header.setField(FIX::MsgType(FIX::MsgType_OrderCancelRequest));
message.setField(FIX::OrigClOrdID("123"));
message.setField(FIX::ClOrdID("321"));
message.setField(FIX::Symbol("LNUX"));
message.setField(FIX::Side(FIX::Side_BUY));
message.setField(FIX::Text("Cancel My Order!"));
FIX::Session::sendToTarget(message);
}
Shows not too much difference. In both cases you have to know which are valid tags to be provided. Maybe, in the second example, the compiler allows you to provide wrong fields, not sure. But at the end, you have to consult which are the available fields to kind of message you want to send (it´s similar to receive, cracking does not help too much, in onMessage you have to know which are the available fields)
So, summarizing. Is it possible to find any smarter way to work with quickfix in order to have more help from the IDE-context? I was thinking about a kind of direct message-class maping.
Thanks a lot for your help. Maybe it´s due to I´m new with quickfix, but I have the feeling that using it oblies you to know messages available fields at the end.

NodeId as string in ModelCompiler OPC UA

I am trying to develop a OPC UA server on my own, but since I am quite a newbie in coding, it is quite hard for me.
I have started from the QuickstartApplication found here: https://github.com/OPCFoundation/UA-.NET-Legacy
in particular I edit the ModelDesign.xml file to customize it as I wish
https://github.com/OPCFoundation/UA-.NET-Legacy/blob/master/ComIOP/Common/Common/ModelDesign.xml
I would like to define some nodes with NodeId as string (all the NodeId in the ModelDesign.xml in the example are numeric)
Following this xsd, I have found "StringId" and "NumericId" that look like what was looking for
https://github.com/OPCFoundation/UA-ModelCompiler/blob/master/ModelCompiler/UA%20Model%20Design.xsd
but changing their value in ModelDesign.xml does nothing about the NodeId. There is no error, just the compiler assigns new NodeIds (all numeric) as if it does not consider the changes I have made.
As a compiler, I am using the ModelCompiler found on GitHub
https://github.com/OPCFoundation/UA-ModelCompiler
Can somebody help me, please? How can I customize the NodeId of the nodes?
Thank you
Edo
the best suggestion that I can offer at this stage is to clone the UA-.NETStandard and run the NetCoreConsoleServer in
UA-.NETStandard/SampleApplications/Samples/NetCoreConsoleServer
through the debugger. The boiler node manager, if my memory serves me well, uses stringIDs. The Interface INodeIdFactory in ISystemContext.cs offers some insight in how ID's are generated.
IMHO, the model designer has no switch to enforce string ID's as you know. So you'll need to programmatically allocate stringID's rather than numeric ID's to nodes upon server boot. I haven't figured it out yet either.
So, you may set breakpoints in the BoilerNodeManager.cs and see how the nodeID is actually constructed.

Talend: How to get instance of a component in tjava

I want ask if there is way to get an instance of a component if a job (ex:tmap, tmysqlinput) in tjava code and then manipulate it manually using code?
Thank you
Very hazardous. Looking at the generated Java code will give you some answers (I think so).
In fact, accessing to some objects properties is possible (there is blogs and articles about this) but changing anything seems to be dangerous (IMHO).
TRF

Using boost's socket.async_send_to()

I've been stuck on this for a while now. I am trying to send the following:
boost::shared_ptr<uint8_t[]> m_data
over the wire using:
_socket.async_send_to(boost::asio::buffer(m_data), m_remote_endpoint,
boost::bind(&UDPServer::handle_send, this, message,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
I get the error "no instance of overloaded function boost::asio::buffer matches the argument list boost::shared_ptr<uint8_t[]>"
m_data is filled in another function.
I suspect this is because I actually have to use the key word new on m_data. But I can't quite figure out how to do it. I've tried a few different variations. Can anybody offer me some insight here? This is probably more a question of how to dereference a shared pointer then anything. Thanks in advance!
boost::asio::buffer has an impressive lists of consttructors, but neither of them takes shared_ptr<[]> (possibly an oversight form lib authors).
In your case, you simply need to derefence shared ptr, for example, by calling get on it.

GWT request .with method

I'm sorry in advance if this rather n00bish question actually has an answer in the documentation which I've just failed to find, but
I'm still relatively new to GWT, and try as I might I can't find an explanation of what the request.with(String...) method actually does which I can understand. Please can someone explain to me in words of one sylable what this method does and why you'd use it?
thanks very much
It indeed is in the doc: https://developers.google.com/web-toolkit/doc/latest/DevGuideRequestFactory#relationships
By default, entity proxies referenced from the entity proxy/ies you're fetching are not fetched (properties will simply be null on the client-side). You have to explicitly ask for them using with(), passing the name (can be a dotted path too) of the properties you want to fetch.