lynixliu / swiftavrocore Goto Github PK
View Code? Open in Web Editor NEWAn implementation of Apache Avro in Swift 5
License: Apache License 2.0
An implementation of Apache Avro in Swift 5
License: Apache License 2.0
public func writeData(url: URL, data: SrcrecJSON) {
// file write
do {
let codec = NullCodec(codecName: AvroReservedConstants.NullCodec)
var writeObjectContainer = try ObjectContainer(schema: avroSchema, codec: codec)
try writeObjectContainer.addObject(data)
let encodeData = try writeObjectContainer.encodeObject()
try encodeData.write(to: url)
} catch {
print("Error writing file: (error)")
}
}
I am encoding json data into avro file and saving it as a file.
The file is encoded properly through the code and saved well.
However, a memory leak occurs every time this operation is performed.
It has been discovered that memory is not organized and continues to accumulate, eventually causing the app to close.
When tracking down memory issues, a problem is suspected with AvroBinaryEncoder.
can you help me?
Demo 没法正常运行
I think this is caused by the lack of a public
keyword here:
SwiftAvroCore/Sources/SwiftAvroCore/FileObject/NullCodec.swift
Lines 62 to 64 in 640aaa5
We were getting an error trying to decode a nested record:
Fatal error: Unexpectedly found nil while unwrapping an Optional value
Here:
Since the error, we've decided to abandon Avro in Swift, so I gave up trying to figure out how to fix this error. I believe that the schemaMap
inside the nested record is invalid. In my tests, the key for my nested field was string
instead of foo
. By that, I mean the key inside the schemaMap
defined AvroDecodable.swift line L243. I didn't get far enough to figure out why this was the case. In all other cases that I could see, the key was set correctly. But it seems like something goes awry with nested record types.
Hi
I am trying the use your library to decode an Avro message which a get via an API call. From this call, I get two things 1st the Schema for the Message in AVRO, 2nd the AVRO binary data. My challenge is that the Schema is unknown to me upfront and now I am struggling with how I can use the Library to decode my message into something unknown at design time. Do you have any suggestions if this can be done with your library??
Thanks, Armin
I accidentally had a copy of this package still inside our app when I tried to upload to the app store and I got this error:
ITMS-90535: Unexpected CFBundleExecutable Key - The bundle at '/Payload/xxx.app/SwiftAvroCore/.build/checkouts/Runtime/Tests/RuntimeTests/Info.plist' does not contain a bundle executable. If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue.
At some point I had dragged the package into the project to be able to edit it and reload in real time. Maybe that was the source of the issue, in which case please feel free to close this issue without comment. I only posted it in case it's helpful in some way. I don't know enough about Swift to know what the issue means.
Firstly, thanks for this library. It's been a huge help to us that we can use Avro in Swift. Much appreciated.
After I imported the library into my React Native .xcworkspace, when I try to build, I find the following errors:
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:13:25 Cannot find type 'uint8' in scope
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:16:47 Cannot find type 'uint8' in scope
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:20:31 Cannot find 'uint8' in scope
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:27:66 Cannot find type 'uint8' in scope
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:47:32 Type of expression is ambiguous without more context
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:85:45 Type of expression is ambiguous without more context
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:104:45 Type of expression is ambiguous without more context
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:109:49 Type of expression is ambiguous without more context
SourcePackages/checkouts/SwiftAvroCore/Sources/SwiftAvroCore/IPC/Response.swift:136:49 Type of expression is ambiguous without more context
I'm super new to Swift, this is the first real project that I'm working on, so I'm a bit lost. I thought the type was UInt8
rather than uint8
, but I don't know if Swift is case sensitive, etc.
Do you have any idea how I could fix this issue? Maybe I have imported the library incorrectly or missed some instructions in the setup?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.