Code Monkey home page Code Monkey logo

swiftavrocore's People

Contributors

chmac avatar darvin avatar kacperk avatar lynixliu avatar standarttemplateconstruct2022 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

swiftavrocore's Issues

how to decode a Schema only available at runtime?

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

Cannot find type 'uint8' in scope and type of expression is ambiguous

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?

Error uploading to App Store

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.

Unable to decode nested records

We were getting an error trying to decode a nested record:

Fatal error: Unexpectedly found nil while unwrapping an Optional value

Here:

https://github.com/chmac/SwiftAvroCore/blob/640aaa5e968c4dab4bea070646efa8d8fef4bd82/Sources/SwiftAvroCore/Codable/AvroDecodable.swift#L246

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.

A memory leak occurs when writing a file.

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.