variant

Spark: Variant Datatype is not supported

我的梦境 提交于 2019-12-24 09:29:15
问题 While extracting the data from SQL Server of variant data type in Pyspark. i am getting a SQLServerException : "Variant datatype is not supported" Please advice for any workaround. 回答1: Converted the column datatype into varchar while fetching and thing worked SELECT CONVERT(varchar,Code,20) into Code from DBTable 来源: https://stackoverflow.com/questions/40786605/spark-variant-datatype-is-not-supported

How is “variant time” (DATE, double, 8-byte) handled?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 03:03:14
问题 I can't seem to find any information on how a "variant time" ( DATE, double, 8-byte variable ) is handled.... I have a variant time " A " which value is " 41716.892329 ". If I convert " A " using "VariantTimeToSystemTime" (or "COleDateTime") - I get " 2014-03-18 21:24:57 ". How is this variant time calculated? Is it capable of storing milliseconds? Is there any way to determine if variant time is an AM or PM time? I'm a bit confused regarding the AM/PM thing because the device that I'm

Assign [array of byte] to a Variant with no Unicode conversion

帅比萌擦擦* 提交于 2019-12-23 21:32:05
问题 Consider the following code snippet (in Delphi XE2): function PrepData(StrVal: string; Base64Val: AnsiString): OleVariant; begin Result := VarArrayCreate([0, 1], varVariant); Result[0] := StrVal; Result[1] := Base64Val; end; Base64Val is a binary value encoded as Base64 (so no null bytes). The ( OleVariant ) Result is automatically marshalled and sent between a client app and a DataSnap server. When I capture the traffic with Wireshark, I see that both StrVal and Base64Val are transferred as

Printing variant types in OCaml

给你一囗甜甜゛ 提交于 2019-12-23 19:10:31
问题 In my OCaml program, I spend considerable time wring "to_string" for variant types over and over again. Either I need them for debugging purpose, or because I need a specific formatted output. So far, they follow a template such as follows: let rec to_string = function | Var x -> x | Implies (f1, f2) -> Printf.sprintf "(=> %s %s)" (to_string f) (to_string f2) | And (f1, f2) -> Printf.sprintf "(& %s %s)" (to_string f1) (to_string f2) | Or (f1, f2) -> Printf.sprintf "(| %s %s)" (to_string f1)

How do I attach optional attributes to values?

走远了吗. 提交于 2019-12-23 12:04:35
问题 I want to store a list of "things" which can have some optional extra attributes attached to them. Each thing can have one or more attributes. And different attributes are of different types. I want to be able to create literal lists of these things concisely in code. But I'm having trouble seeing how to get this past the type system because tuples allow mixtures of types but are fixed length, while lists are variable length but one type. This is a toy example of what I want to be able to do

Does VBScript have a DateTime.TryParse equivalent?

淺唱寂寞╮ 提交于 2019-12-23 10:28:27
问题 Given a variant, does VBScript have an equivalent of C#'s DateTime.TryParse method? 回答1: Use IsDate(stringDate) in conjunction with CDate(stringDate). Use the IsDate() function to determine if date can be converted to a date or time. CDate() recognizes date literals and time literals as well as some numbers that fall within the range of acceptable dates. When converting a number to a date, the whole number portion is converted to a date. Any fractional part of the number is converted to a

Writing cell in Excel from C++ - no value written, cell is blank

隐身守侯 提交于 2019-12-23 05:15:43
问题 When I write a cell from C++ with OLE to a cell in Excel, I get an empty cell. Whatever value is there gets overwritten to be blank. It writes in the correct cell though, so it seems the range is correct. This is my code. VARIANT arr; BSTR val = SysAllocString(L"hello excel world"); _bstr_t(val, false); arr.vt = VT_ARRAY | VT_VARIANT; SAFEARRAYBOUND sab[1]; sab[0].lLbound = 1; sab[0].cElements = 1; arr.parray = SafeArrayCreate(VT_VARIANT, 1, sab); long indices[] = {1, 1}; SafeArrayPutElement

Selected range of Excel cells passed to an argument “as Variant” of a VBA function, then passed to an method of an ATL object in c++

我与影子孤独终老i 提交于 2019-12-23 04:31:44
问题 This question arose from the following question : Chaining methods of ATL/COM objects Let's say I have a instance MyObj1 of an ATL/COM class TheClass of a dll exposed to vba, and a method TheMethod of TheClass . In VBA, I have a function Public Function func(x as Variant) as Variant '... something MyObj1.TheMethod( x ) '... other things End Function This function is used in excel, and I pass an excel range of cell to it. At debug in VBA, x is seen of vba type " Variant/Object/Range ", and has

Selected range of Excel cells passed to an argument “as Variant” of a VBA function, then passed to an method of an ATL object in c++

懵懂的女人 提交于 2019-12-23 04:31:42
问题 This question arose from the following question : Chaining methods of ATL/COM objects Let's say I have a instance MyObj1 of an ATL/COM class TheClass of a dll exposed to vba, and a method TheMethod of TheClass . In VBA, I have a function Public Function func(x as Variant) as Variant '... something MyObj1.TheMethod( x ) '... other things End Function This function is used in excel, and I pass an excel range of cell to it. At debug in VBA, x is seen of vba type " Variant/Object/Range ", and has

Marshalling arrays of VARIANT using P/Invoke

瘦欲@ 提交于 2019-12-22 10:40:00
问题 Situation: I have a managed (C#, .NET 2.0) application which uses an unmanaged (C++) DLL using P/Invoke. Along with the "simple" methods (POD arguments/return value) there's a requirement to pass a boost::variant value arrays to the code. The reason for it is that these methods pass report data (similar to Excel cells, which can be of any type). C# code accepts them as boxed "object"'s. The previous implementation called for use of SafeArray of COM VARIANT's. However, due to poor coding/not